Qlik Community

QlikView Documents

Documents for QlikView related information.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More

Sample Generic Load Script

MVP & Luminary
MVP & Luminary

Sample Generic Load Script

This document helps in understanding Generic Load concept which pivots/transpose given data.

Attachments
Comments
MVP & Luminary
MVP & Luminary

Hi Jagan,

I recommend to complete the example with a table coonsolidation:

Table1:

load * inline [

ID,name,type,value

1,A,blue,10

1,A,yellow,50

3,C,red,80

3,C,yellow,60

4,D,yellow,40

];

Table2:

generic load *

resident Table1;

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;

- Ralf

MVP & Luminary
MVP & Luminary

Thanks Ralf, good idea.

Regards,

Jagan.

0 Likes
Not applicable

Can any body explain the script and use of noftables() function and  $(i ) means

0 Likes
Partner
Partner

It is a very handy re-usable code snipplet you posted here rbecher‌‌. Thanks for sharing. 

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2012-05-01 01:49 AM
Updated by: