Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a folder where I have similar QVDs with same table structure:
QVDs | Generated Time |
Table_Jan 2015 | 4/2/2015 |
Table_Feb 2015 | 4/2/2015 |
Table_Mar 2015 | 4/2/2015 |
Table_Apr 2015 | 4/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!
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
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?
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
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
may be try this:
Table:
Concatenate
LOAD
*
FROM Path\Table_*
(qvd);
Store Table into Path.qvd (qvd);
DROP Table Table;
Tested with this one as well.... No help again
Will you be able to post your qvw here? Otherwise it is hard to say what the issue could be.
Hi,
Enclosed herewith
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