Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Hope you are doing well!
I have a QVD which consists of multiple clients data(Ex: 4 clients). Here my requirement is to store this QVD into multiple folders based on client name.
For Example: Client 1 data I have to store into Folder 1 and Client 2 data I have to store into Folder 2 and so on....
But I have to achieve this with single reload
, May be through loops we may achieve this.
Can any one suggest a way to achieve this?
Many Thanks in Advance!
Hi,
Thank you so much for your post as its resolved my issue with little bit changes in script.
Thank You,
SP
With just four clients you could just repeat yourself four times. Something like this:
client1: load * from [qvdfile] (qvd) where CLIENT=1;
store client1 into [qlient1.qvd] (qvd);
drop table client1;
Do the same for each client. If you’ve got many clients you could first load distinct client from [qvdfile] into a table, and after that you do a for-loop that iterates over that table, extract the client (e.g. with peek() function) into a variable and use the value to load the correct client data from your qvd and store it where you want it.
Sample script below
Replace ClientField to be exact field name that has the Client values
KeepClients:
Load * inline [
ClientList
C1
C2
C3
C4
];
for each clnt in fieldvaluelist('ClientList')
Set vTableName = $(clnt) ;
KeepClnt:
Load '$(clnt)' as ClientField
AutoGenerate 1;
$(vTableName):
Load *
From MainQvd.qvd(qvd)
Where Exists(ClientField);
Store $(vTableName) into [lib://Somefolder/$(vTableName).qvd](qvd);
Drop table $(vTableName);
Drop table KeepClnt;
next clnt;
Drop table KeepClients;
exit Script;
Hi,
Thank you so much for your post as its resolved my issue with little bit changes in script.
Thank You,
SP