Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

creating a combined QVD after generic load.

Hi all,

I hope all of you doing good.

I have used Generic keyword before the load statement so that it splits the table into multiple tables(based on each attribute). Now i want crate a QVD which should contain all tables(tables craeted after generic load) data....I tried to create this QVD by  doing left joins...but i want to create the QVD dynamically...tried for loop but no luck.

Please help me overcome this issue ASAP.

Thanks,

Sudhir

2 Replies
Nicole-Smith

This should do the trick:

Jobcodes2:

generic

load SALE_ORD,

SALE_STATUS,

RECEIVED,

JOB_CD as ATTRIBUTE,

DATE AS VALUE

from Jobcodes1.qvd(qvd);

Set vListOfTables = ;

For vTableNo = 0 to NoOfTables()

  Let vTableName = TableName($(vTableNo)) ;

    Let vListOfTables = vListOfTables & If(Len(vListOfTables)>0,',') & Chr(39) & vTableName & Chr(39) ;

Next vTableNo

CombinedGenericTable:

Load distinct

  SALE_ORD,

  SALE_STATUS,

  RECEIVED

From Jobcodes1.qvd(qvd);

For each vTableName in $(vListOfTables)

  If vTableName like 'Jobcodes2.*' Then

  Left Join (CombinedGenericTable)

  Load * Resident $(vTableName);

     Drop Table $(vTableName);

  Endif

Next vTableName;

Store * From CombinedGenericTable Into Jobcodes2.qvd (qvd);

danihs
Contributor
Contributor

Thank you very very much, it worked for me!!