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!
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
oops,
you are correct - just wrote without thinking/testing.
On the first run it should be a simple LOAD, thereafter LOAD CONCATENATE ...
Peter
Hey, Many thanks to you Peter and Sunny,
I will work on your suggestion and let you know!
In case that there might be duplicated values, you may add
'$(vFile)' AS FileName
as scriptline in order to identify the source
Peter