Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
dmohanty
Partner - Specialist
Partner - Specialist

Concatenate QVDs- Similar but different reload time -HOW?

Hi All,

I have a folder where I have similar QVDs with same table structure:

QVDsGenerated Time
Table_Jan 20154/2/2015
Table_Feb 20154/2/2015
Table_Mar 20154/2/2015
Table_Apr 20154/4/2015

I want to Concatenate All the QVDs which have a same name for different months - means all the four needs to be concatenated, disregard of time generated. I am writing the script like this below:

FOR EACH vFile in FileList('$(vSnapshotQVDPath)\Table_*.qvd')

     

Table:

LOAD

*

FROM $(vFile)(qvd);

NEXT vFile ;

STORE Table into $(vFactQVDPath)\Table.qvd;

DROP Table Table;

However it always takes the QVD generated in latest timestamp and stores in QVD and the old ones are concatenated and stored in QVW itself.

Table_Apr 2015 is going to store in QVD and previous 3 are concatenated and stored in QVW itself (I don't need this)

I want all the QVDs to be concatenated and stored in QVD irrespective of time.

Please help me here.

Regards!

13 Replies
sunny_talwar

Shouldn't this be the opposite like this prieper:

LET sConcatenate = '';

FOR each vFile in FileList('$(vSnapshotQVDPath)\POH_FACT_*.qvd')

 

POH_FACT:

$(sConcatenate) LOAD

*

FROM $(vFile)(qvd);

LET sConcatenate = 'Concatenate';

NEXT vFile ;

STORE POH_FACT into $(vFactQVDPath)\POH_FACT.qvd;

DROP Table POH_FACT;



The first time going into the loop, POH_FACT doesn't really need Concatenate, but with every other time it loops, it needs to concatenate to POH_FACT?

Please let me know if I am not thinking it the right way.

Best,

Sunny

prieper
Master II
Master II

oops,

you are correct - just wrote without thinking/testing.

On the first run it should be a simple LOAD, thereafter LOAD CONCATENATE ...

Peter

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hey, Many thanks to you Peter and Sunny,

I will work on your suggestion and let you know!

prieper
Master II
Master II

In case that there might be duplicated values, you may add

'$(vFile)'     AS FileName

as scriptline in order to identify the source

Peter