Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm looking for a solution where I need to transpose a table from rows to columns. The example below works as intended, but I have about 400 ProdID's, any suggestions how to solve this in a smart way?
Thanks,
Jonas
OrgData:
load *Inline
[Knumber, ProdID, Value
1,6,1000
2,7,2000
3,8,3000
4,9,4000
5,10,5000
];
RowsToCols:
LOAD Knumber,
ProdID AS Prod1,
Value
RESIDENT OrgData
WHERE ProdID = '6';
CONCATENATE LOAD Knumber,
ProdID AS Prod2,
Value
RESIDENT OrgData
WHERE ProdID = '7';
CONCATENATE LOAD Knumber,
ProdID AS Prod2,
Value
RESIDENT OrgData
WHERE ProdID = '8';
// ProdID = 9, 10 e.t.c ...
DROP TABLE OrgData;
Have a look into GENERIC LOAD:
http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/31/generic
OrgData:
load *Inline
[Knumber, ProdID, Value
1,6,1000
2,7,2000
3,8,3000
4,9,4000
5,10,5000
];
Generic Load * Resident OrgData;
Drop Table OrgData;
Hi Jonas, I just have a problem like that.
I suggest you to see:
- Option TANSPOSE acquiring data from external source (not inline)
or
- CROSSTABLE