Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem storing multiple QVDs using FOR NEXT

I am trying to create multiple QVDs based on a Product Line ID from a RESIDENT table.

I can't understand what is wrong with the following code -- PLEASE HELP!

 

SET vQVD_Stage='C:\Users\hayetom\Qlikview\QlikView Working Folders\QVD\';

AllData:
LOAD * FROM $(vQVD_Stage)Data_Source.qvd (qvd);

Product_Line_List:
LOAD DISTINCT PROD_LN_ID as SaveProd_Line_ID

RESIDENT AllData;

LET vNumProductLines = NoofRows ('Product_Line_List');

SET ii = 0;

FOR ii = 0 to $(vNumProductLines) - 1

LET vSaveProd_Line_ID = peek ('SaveProd_Line_ID', ii, 'Product_Line_List');

DataSubSet:

LOAD *
RESIDENT AllData
WHERE (PROD_LN_ID = '$(vSaveProd_Line_ID)');
STORE DataSubSet INTO $(vQVD_Stage)Data_Source_For_$(vSaveProd_Line_ID).qvd (qvd);
DROP TABLE DataSubSet;

NEXT

1 Solution

Accepted Solutions
Gysbert_Wassenaar

This will load the exact same fields as exist in AllData, so the data will be appended to AllData and DataSubSet won't be created. Try adding a noconcatenate to the load statement:

DataSubSet:

NOCONCATENATE

LOAD *
RESIDENT AllData


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

This will load the exact same fields as exist in AllData, so the data will be appended to AllData and DataSubSet won't be created. Try adding a noconcatenate to the load statement:

DataSubSet:

NOCONCATENATE

LOAD *
RESIDENT AllData


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi Hayes,

the table 'AllData' concatenated with 'DataSubSet'

SET vQVD_Stage='C:\Users\hayetom\Qlikview\QlikView Working Folders\QVD\';

AllData:
LOAD * FROM $(vQVD_Stage)Data_Source.qvd (qvd);

Product_Line_List:
LOAD DISTINCT PROD_LN_ID as SaveProd_Line_ID

RESIDENT AllData;

LET vNumProductLines = NoofRows ('Product_Line_List');

SET ii = 0;

FOR ii = 0 to $(vNumProductLines) - 1

LET vSaveProd_Line_ID = peek ('SaveProd_Line_ID', ii, 'Product_Line_List');

DataSubSet:

NoConcatenate

LOAD *
RESIDENT AllData
WHERE (PROD_LN_ID = '$(vSaveProd_Line_ID)');
STORE DataSubSet INTO $(vQVD_Stage)Data_Source_For_$(vSaveProd_Line_ID).qvd (qvd);
DROP TABLE DataSubSet;

NEXT

-------------

Hola Hayes,

la tabla AllData se esta concatenando con DataSubSet