Qlik Community

QlikView Documents

Documents for QlikView related information.

Sample Generic Load Script

MVP
MVP

Sample Generic Load Script

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

Attachments
Comments
MVP
MVP

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
MVP

Thanks Ralf, good idea.

Regards,

Jagan.

Not applicable

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

Vegar
Valued Contributor

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

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