Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Multi Load in one store

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

Tags (2)
1 Solution

Accepted Solutions
giakoum
Honored Contributor II

Re: Multi Load in one store

put the store command outside the loop. My guess is you are storing on the same file in every loop. Otherwise share your script

8 Replies
giakoum
Honored Contributor II

Re: Multi Load in one store

put the store command outside the loop. My guess is you are storing on the same file in every loop. Otherwise share your script

Not applicable

Re: Multi Load in one store

Thanks for you help.

it's the same thing outside the loop, it only take the last one.

giakoum
Honored Contributor II

Re: Multi Load in one store

you need to share your script otherwise we cannot really help you by guessing

Employee
Employee

Re: Multi Load in one store

Is everything loaded into one table before you store it? Store can only export from one data table, unless you join the tables explicitly.

Gabriel
Valued Contributor II

Re: Multi Load in one store

Hi,

Are you dropping the last table stored.

Within your loop and after storing the table your have to DROP TABLE dynamically


Not applicable

Re: Multi Load in one store

Sorry I came to send my script

giakoum
Honored Contributor II

Re: Multi Load in one store

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....

Employee
Employee

Re: Multi Load in one store

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.

Community Browser