Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Actually I need to make some LOAD in one Store. I made a loop for to load everything I need but my STORE only take the last one.
If you have some ideas to fix that.
CONVERT:
LOAD
A as Country_Code,
M as User_Id,
N as Password,
E as Refresh_Group
FROM AAA.xlsx (ooxml, no labels, table is DATA)
where E = 'X';
for e = 1 to FieldValueCount('Refresh_Group')
for m = 1 to FieldValueCount('Country_Code');
let vUserId = FieldValue('User_Id', $(m));
let vPassword = FieldValue('Password', $(m));
let vCountryCode = FieldValue('Country_Code', $(m));
YourTable:
LOAD * FROM [ftp://$(vUserId):$(vPassword)@11.111.11.111/DV/AAA - $(vCountryCode) - AAA.xlsx]
(txt, codepage is 1252, embedded labels, delimiter is ';', no quotes, table is Feuil1);
//STORE CONVERT into TABLESv2/AAA.qvd(qvd);
let vUserId = '0';
let vPassword = '0';
NEXT
NEXT
STORE CONVERT into TABLESv2/AAA.qvd(qvd);
Regards
put the store command outside the loop. My guess is you are storing on the same file in every loop. Otherwise share your script
put the store command outside the loop. My guess is you are storing on the same file in every loop. Otherwise share your script
Thanks for you help.
it's the same thing outside the loop, it only take the last one.
you need to share your script otherwise we cannot really help you by guessing
Is everything loaded into one table before you store it? Store can only export from one data table, unless you join the tables explicitly.
Hi,
Are you dropping the last table stored.
Within your loop and after storing the table your have to DROP TABLE dynamically
Sorry I came to send my script
do all qvds have the same fields?
create the table outside the script with a dummy field for example :
YourTable:
load null() as dummy
autogenerate(0);
and then use concatenate like this in the loop :
concatenate(YourTable)
load....
Well, you are storing CONVERT which was loaded at the beginning, before the loop, so that would only store once.
Inside the loop you are creating YourTable.
If you want to create several similar tables in a loop and store them individually, here's an example:
For counter = 1 to 3
set filename=x$(counter).qvd;
Table1:
Load $(counter) As loop_pass autogenerate 1;
Store Table1 into $(filename) (qvd);
Drop table Table1;
Next
This will create 3 qvd files (x1, x2, x3)
As was said before, you need to drop the table in the loop before generating it again.