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: 
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

If the file name is consistent across different qvd and they all sit in the same folder, why don't you try to load them without For loop like this:

Table:

LOAD

*

FROM Path\Table_*

(qvd);

Store Table into Path.qvd (qvd);

DROP Table Table;

I am not sure if this isn't the best way to do it, but this has worked for me.

Best,

Sunny

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hi Sunny,

I agree with your approach, but not sure HOW and WHY, only the QVDs generated on latest timestamp are stored in QVDs and rest old ones are stored in QVW.

Any Clue?

sunny_talwar

When you say they are stored in the qvw, you mean that you can see them in the table viewer of your qvw? If that is the case are they named Table-1, Table-2.... and so on???

Is this the exact script you are using?

Best,

Sunny

dmohanty
Partner - Specialist
Partner - Specialist
Author

You are absolutely correct.

All the QVDs are of same name (only suffixed with Month name) but generated on different dates. So the QVDs generated latest are grouped and stored into QVD.

The previous ones are stored in QVW as Table-1, Table-2 etc in QVW. I can see them in Table viewer (may be with Synthetic Tables also).

Yes, the above script I am using. I also tried the way you told. But no help

sunny_talwar

‌may be try this:

Table:

Concatenate

LOAD

*

FROM Path\Table_*

(qvd);

Store Table into Path.qvd (qvd);

DROP Table Table;

dmohanty
Partner - Specialist
Partner - Specialist
Author

Tested with this one as well.... No help again

sunny_talwar

Will you be able to post your qvw here? Otherwise it is hard to say what the issue could be.

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hi,

Enclosed herewith

prieper
Master II
Master II

You may change your script to:

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;

HTH Peter

edit: wrong string for concatenation corrected in order not to post incorrect code