Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
dmohanty
Partner - Specialist
Partner - Specialist

Concatenate QVDs using a For Loop?

Hi All,

I have a set of QVDs having the same Data Structure for different months (some months may be missing), like this below:

Fact_Jan2014.qvd

Fact_Feb2014.qvd

Fact_May2014.qvd

Fact_July2014.qvd

...

Fact_Dec2014.qvd

Now the target is to concatenate all the QVDs into a single QVD called Fact.qvd. Could you please help doing it using a For Loop or any other ways?

Regards!

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

For file in filelist ('Fact*.qvd')

T1:

LOAD * from $(file)

next

Store T1 into newqvd.qvd(qvd);

View solution in original post

7 Replies
Clever_Anjos
Employee
Employee

For file in filelist ('Fact*.qvd')

LOAD * from $(file)

next

dmohanty
Partner - Specialist
Partner - Specialist
Author

Thank you Anjos!

How you are storing the same into QVD?

Clever_Anjos
Employee
Employee

For file in filelist ('Fact*.qvd')

T1:

LOAD * from $(file)

next

Store T1 into newqvd.qvd(qvd);

Anonymous
Not applicable

Actually, there is no need for a loop in this particular case, simply

LOAD * FROM Fact_*.qvd (qvd);

dmohanty
Partner - Specialist
Partner - Specialist
Author

I just did like this below and getting the error (highlighted)

FOR EACH vFile in FileList('$(vMonthQVDPath)\Metric\PO_Min*.qvd')

           

CONCATENATE

           

PO_Min:

     LOAD *

     FROM [$(vFile)] (qvd);

NEXT vFile

Store PO_Min into $(vMonthQVDPath)\Metric\PO_Min.qvd;

FOR EACH vFile in FileList('E:\Med_Supplier_QV_Files\Source\Medical_QVD_Generators\Snapshot QVDs\Metric\PO_Min*.qvd')

1/26/2015 5:12:05 PM: 0031    CONCATENATE

1/26/2015 5:12:05 PM: 0032               

1/26/2015 5:12:05 PM: 0033    PO_Min:

1/26/2015 5:12:05 PM: 0034         LOAD *

1/26/2015 5:12:05 PM: 0035         FROM (qvd)

1/26/2015 5:12:05 PM:         14 fields found: Supplier ID, Month_Year, Month/Year, PLANT_ID, PROD_KEY_NUM, MIN_NET_ORDER_VALUE_AMT, ORDER_UNIT_PO_QTY, APO_LOCATION_KEY_NUM, CLNDR_MTH_KEY_NUM, STD_COST_AMT, ROW_UPDATE_STP, FINAL_FCST_QTY_WKLY, Meet Min (Yes/No), Flag_PO_Min, General Script Error

1/26/2015 5:12:05 PM:         Execution Failed

1/26/2015 5:12:05 PM:      Execution finished.

Clever_Anjos
Employee
Employee

Why did you put CONCATENATE there? They have different structure?

dmohanty
Partner - Specialist
Partner - Specialist
Author

Yes Anjos,

MY Bad....The CONCATENATE created the problem!

Realized now..... Thank you for help