Skip to main content
Solved

how to Transpose CSV Data and Add Rows For New Data Pairs


ecx
Contributor
Forum|alt.badge.img+4

I currently have a dataset, see top half of picture below, that I wish to transform/transpose into the format that can be seen in the bottom half of the image. The blue/green/peach coloured fields are date/measurement.

 

Data example, top half is current data, bottom half is desired output 

I am totally unsure of where to begin with this, the current transposer tools seem to only be able to do simple transposing without adding the additional rows of location/sourcetype/date/measurement I need. As can be seen I want to make a individual row for each date/measurement combination.

 

I have also attached sample data in xlsx and csv.

 

Any help would be appreciated!

Best answer by nielsgerrits

One way to do this is to explode the attributes into features and create Date and FlowTotal from _attr_name and _attr_value. Added sample workspace demonstrating this.

View original
Did this help you find an answer to your question?

nielsgerrits
VIP
Forum|alt.badge.img+54

One way to do this is to explode the attributes into features and create Date and FlowTotal from _attr_name and _attr_value. Added sample workspace demonstrating this.


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • May 31, 2023

This sort of workflow should work here

AttributeExploder keeping the Attributes, followed by keeping only the relevant attributes, followed by keeping only those features where the Date field contain something in the format Apr-19

imageYou then probably need to do some date formatting to get the date in your preferred format

image


ecx
Contributor
Forum|alt.badge.img+4
  • Contributor
  • June 2, 2023
nielsgerrits wrote:

One way to do this is to explode the attributes into features and create Date and FlowTotal from _attr_name and _attr_value. Added sample workspace demonstrating this.

This worked great! The attribute exploders did exactly what was needed in this situation. Thank you!


ecx
Contributor
Forum|alt.badge.img+4
  • Contributor
  • June 2, 2023
ebygomm wrote:

This sort of workflow should work here

AttributeExploder keeping the Attributes, followed by keeping only the relevant attributes, followed by keeping only those features where the Date field contain something in the format Apr-19

imageYou then probably need to do some date formatting to get the date in your preferred format

image

Great! Thank you for your answer, the attribute exploder was the key to getting this done!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings