Skip to main content
Question

Column names to several different rows

  • November 6, 2024
  • 2 replies
  • 27 views

a_ericsson
Contributor
Forum|alt.badge.img+3

Hey! 

I’m trying to do something that in my mind is very tricky, mainly because I don’t know how to do this. I have a table with bird “routes”. For some reason, each bird species is in a separate column, with a value for the number of individuals in that column. It can look something like this: 

 

In row 2, at one given location, 1 “Stare” and 1 “Grönfink” have been spotted. There are around 190 columns, making this table a bit odd to work with. To work with this data in a different project, I would like the table structured differently. What i would like as an output is a seperate row for each observation, with number of individuals as a seperate column. So, in this case, row 2 would be 2 rows, one for the “Stare”-observation and one for the “Grönfink”-observation. Basically, turning the column names into attribute values. 

 

Does anyone on this forum have any experience from this? Any help would be greatly appreciated! 

 

Cheers!

/Alex

2 replies

ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • November 6, 2024

The attributeexploder will do this. I would map your 0 values to missing with a nullattributemapper before doing the exploding


a_ericsson
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • November 6, 2024
ebygomm wrote:

The attributeexploder will do this. I would map your 0 values to missing with a nullattributemapper before doing the exploding

Thank you very much! :) 


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