Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
In the attached QVW you will see just a single table (XX)
One of the fields in that table is called QVDFilename which I have constructed from other fields and it signifies (as the name implies) the QVD file that the particular row should be written to. This file has a total of 8 different QVD files
Can anyone thing of any way of creating these QVDs?
I have been racking my brain and cannot find a way.
Thanks in advance
Alexis
*** File not empty now - Thanks Rob ****
If all your data is contained in one table and you want to write different parts of the table to a different file:
//Script
[Data Table];
//create a string with all the file names:
QVDFileNames:
Load chr(39) & concat(distinct QVDFilename, chr(39) & ',' & chr(39)) & chr(39) as QVDFileNames
Resident [Data Table];
//put them in a var
LET vQVDFileName = Peek('QVDFileNames', 0, 'QVDFileNames');
//drop the table with file names
drop table QVDFileNames;
//Create a loop
FOR Each vQVDFileName in $(vQVDFileName)
//Filter out the table:
QVDToStore:
NoConcatenate
LOAD * Resident [Data Table] where QVDFileName = '$(vQVDFileName)';
//Store the sub-table into QVD
STORE QVDToStore into '$(vQVDFileName)'.qvd (QVD);
//Drop the sub table
DROP Table QVDToStore;
//next vQVDFileName
NEXT
//drop the original table
DROP TABLE [Data Table];
Is this what you're looking for?
The qvw you posted is empty.
Thanks Rob - reloaded - try now!
If all your data is contained in one table and you want to write different parts of the table to a different file:
//Script
[Data Table];
//create a string with all the file names:
QVDFileNames:
Load chr(39) & concat(distinct QVDFilename, chr(39) & ',' & chr(39)) & chr(39) as QVDFileNames
Resident [Data Table];
//put them in a var
LET vQVDFileName = Peek('QVDFileNames', 0, 'QVDFileNames');
//drop the table with file names
drop table QVDFileNames;
//Create a loop
FOR Each vQVDFileName in $(vQVDFileName)
//Filter out the table:
QVDToStore:
NoConcatenate
LOAD * Resident [Data Table] where QVDFileName = '$(vQVDFileName)';
//Store the sub-table into QVD
STORE QVDToStore into '$(vQVDFileName)'.qvd (QVD);
//Drop the sub table
DROP Table QVDToStore;
//next vQVDFileName
NEXT
//drop the original table
DROP TABLE [Data Table];
Is this what you're looking for?
Attached.
On paper that is precisely what I want - let me try on my original application and revert.
I'm very optimistic 🙂
Thanks again
Alexis
Clay that was PERFECT.
Exactly what I was after - thank you very much..
Alexis
It might need some slight tweaking, especially around the store-statement, but it should work. Let me know.
C ;o)
No worries.
C ;o)