Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nathan_roadshow
Contributor
Contributor

Adjusting the fields to combine to one

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!

Labels (1)
1 Solution

Accepted Solutions
anat
Master
Master

crosstable (Month, Sales) LOAD * from $(SourcePath)source.txt;

View solution in original post

3 Replies
anat
Master
Master

nathan_roadshow
Contributor
Contributor
Author

Thanks @anat this looks similar to what I need, thankyou. If you had the syntax also that'd be handy!

anat
Master
Master

crosstable (Month, Sales) LOAD * from $(SourcePath)source.txt;