Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Amoriel
Contributor
Contributor

Get a value from a certain field into another column

Hey guys,

I know this is a dumb question probably but it seems I can't figure it out and I'd rather ask and learn than stay dumb forever. 😀

I have a data set (please see the attachment), where there are multiple tables like this one. The plan is to unpivot all of the tables and in the end have the "long structure" instead of "wide structure". However I can't do it just yet because the Sub-sections are not unique to a table, I have to - somehow - get the Header 1 and Header 2 into two separate columns to keep the data from mashing into one big mess.

I tried to use an If statement to check if the Previous() row is blank and the current row is not blank and the next one is also blank, then Header 1 as [some new column] but that is just not working, it looks like it's just moving my rows down the table. I'm probably just using it wrong, don't really know. Do I need some sort of a loop through field values?

I will be grateful for any advice. 🙂

Labels (1)
2 Replies
Amoriel
Contributor
Contributor
Author

Thanks for the link but I am not at that step yet, also crosstable causes me some really weird issues - it deletes my 2nd row, where the Header 1 is in this example. I thought it might be because there is a blank row above and below it, so I tried to load data using WHERE to see only values that are not blank and then tried the crosstable, just to check it out if it might be helpful but nope, it disappeared as well.

 

I wish I could post the real dataset here, so you could see, what crazy stuff is happening here. 😄