Discussion Board for collaboration on QlikView Scripting.
I want to transform table nr1 into table nr2 throught scripting.
This example is with 3 columns but they should be as many as the maximum cases for one ID.
Thank you in advance for the help.
Go to Solution.
It's a bad idea because it messes up your data model. You should keep the data as it is and use a pivot table chart object to show it in the format that table nr2 has.
But, if you insist....
load ID, Q1,if(previous(ID)=ID,peek('Ctr')+1,1) as Ctr INLINE [
load 1 as ID AutoGenerate 1;
for i = 1 to FieldValueCount('Ctr')
load ID, Q1 as 'Q1.$(i)'
where Ctr = $(i);
drop table Input;
have you try generic loads?
nr2:GENERIC LOAD ID,'Q1.'&ID ,Q1RESIDENT nr1;
GENERIC LOAD ID,'Q1.'&ID ,Q1
let me know if works..
Thanks a lot.
You are right, but this is not for the data model. I just need to to automate some outputs for third party aplications.