Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I just wondering is this possible to do in Qlik Data load editor
I try to do the crosstab and generic load and still doesn't get the result that I want.
If it are only a few dimension-values you may consider a more manual approach like:
t: load group, value as new from X where title = 'new';
join(t) load group, value as old from X where title = 'old';
but by an undefined number of values the mentioned generic load would be easier.
The script below creates the table you desire in the example above.
GenericDB:
load * inline [
group, title, value
a,new,8
a,old,9
b,new,2
b,old,6
c,new,4
c,old,7
];
GenericLabel:
Generic load group, title, value resident GenericDB;
let vListOfTables = ;
For vTableNo = 0 to NoOfTables()
Let vTableName = TableName($(vTableNo)) ;
If Subfield(vTableName,'.',1)='GenericLabel' Then
Let vListOfTables = vListOfTables & If(Len(vListOfTables)>0,',') & Chr(39) & vTableName & Chr(39) ;
End If
Next vTableNo
CombinedGenericTable:
Load distinct group Resident GenericDB;
For each vTableName in $(vListOfTables)
Left Join (CombinedGenericTable) Load * Resident [$(vTableName)];
Drop Table [$(vTableName)];
Next vTableName
//Drop table GenericDB
I suggest you to take a second look at the generic load. Maybe this old post about the generic load written by HIC may help you forward.
https://community.qlik.com/t5/Design/The-Generic-Load/ba-p/1473470
If it are only a few dimension-values you may consider a more manual approach like:
t: load group, value as new from X where title = 'new';
join(t) load group, value as old from X where title = 'old';
but by an undefined number of values the mentioned generic load would be easier.
The script below creates the table you desire in the example above.
GenericDB:
load * inline [
group, title, value
a,new,8
a,old,9
b,new,2
b,old,6
c,new,4
c,old,7
];
GenericLabel:
Generic load group, title, value resident GenericDB;
let vListOfTables = ;
For vTableNo = 0 to NoOfTables()
Let vTableName = TableName($(vTableNo)) ;
If Subfield(vTableName,'.',1)='GenericLabel' Then
Let vListOfTables = vListOfTables & If(Len(vListOfTables)>0,',') & Chr(39) & vTableName & Chr(39) ;
End If
Next vTableNo
CombinedGenericTable:
Load distinct group Resident GenericDB;
For each vTableName in $(vListOfTables)
Left Join (CombinedGenericTable) Load * Resident [$(vTableName)];
Drop Table [$(vTableName)];
Next vTableName
//Drop table GenericDB
Thank you for your help. I try the script from https://community.qlik.com/t5/Design/The-Generic-Load/ba-p/1473470 and it's making me confuse. You help me understanding more with your script. Thank a lots.
Thank you for your help. Your script are works as well.