Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I'm trying to resolve the below first table and turn it to the second.
I would like to turn the field to a field header and populate all rows below it.
I have a table output from Qlik like this:
Fruit | 1 | 2 | 3 | 4 | 5 |
Apple | null | 10 | |||
Pear | null | 5 | |||
Apple | 12 | ||||
Pear | 1 | ||||
Apple | 123 | ||||
Pear | 12 | ||||
Apple | 80 | ||||
Pear |
29 |
However my goal is to translate that to a table like this, where everything is combined kind of in a field, and an alternate row, where the field header is it's own field, and then the sales are combined to a column:
Fruit | Month | Sales |
Apple | 1 | null |
Pear | 1 | null |
Apple | 2 | 10 |
Pear | 2 | 5 |
Apple | 3 | 12 |
Pear | 3 | 1 |
Apple | 4 | 123 |
Pear | 4 | 12 |
Apple | 5 | 80 |
Pear | 5 | 29 |
What's the best way to do this?
I hope this is an easily solution!
crosstable (Month, Sales) LOAD * from $(SourcePath)source.txt;
u can use the crosstable function
Working with crosstables in the data load script ‒ Qlik Sense on Windows
Thanks @anat this looks similar to what I need, thankyou. If you had the syntax also that'd be handy!
crosstable (Month, Sales) LOAD * from $(SourcePath)source.txt;