Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI ALl,
I dint get the answer in Scripting forum that is why I am posting here. Please help.
I have seen so many posts on Generic Load.
After writting Generic load statement (
Table2:
generic load *
resident Table1
)
i see the below code
ResultTable:
LOAD Distinct ID, name Resident Table1;
FOR i = 0 to NoOfTables()
TableList:
LOAD TableName($(i)) as Tablename AUTOGENERATE 1
WHERE WildMatch(TableName($(i)), 'Table2.*');
NEXT i
FOR i = 1 to FieldValueCount('Tablename')
LET vTable = FieldValue('Tablename', $(i));
LEFT JOIN (ResultTable) LOAD * RESIDENT [$(vTable)];
DROP TABLE [$(vTable)];
NEXT i
Drop Tables Table1, TableList
Can anyone please make me understand the above code step by step what it is actually doing? Is above mentioned code is common one?
Generic loads generate multiple tables associated by at least one common field.
The code fragement you posted recombines those tables into one and drops the corresponding source tables, i.e. it generates one table that includes all fields generated by the generic load.
For pros and cons see also:
http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/31/generic
Use cases for Generic Load | Qlikview Cookbook
hope this helps
regards
Marco
That's explained in this blog post: The Generic Load.
Don't create the ResultTable unless it is necessary for further processing or you need to export it.