Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help on Generic Load

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?

2 Replies
MarcoWedel

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

by Henric Cronström

Use cases for Generic Load | Qlikview Cookbook

by Rob Wunderlich

hope this helps

regards

Marco

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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.


talk is cheap, supply exceeds demand