Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
atsushi_saijo
Creator II
Creator II

Automated Table Creation + STORE

Would you advise if it is possible to use loop (For...Next) to create table/Store it in a automated manner?

I have created a table like this, like 'Source' table

ts
AAAAAaaAA.xlsx(ooxml, embedded labels, table is a)
BUTcSisdsDI.xlsx(ooxml, embedded labels, table is b)
HWISAsdA.xlsx(ooxml, embedded labels, table is c)
SSRdfd.xlsx(ooxml, embedded labels, table is dofa0)

Preferred loading script is:

For i=0 to 3

LET Tbl=PEEK('Source',$(i),'t');

LET Src=PEEK('Source',$(i),'s');

$(Tbl): LOAD * from $(Src);

STORE $(Tbl) into $(Tbl).QVD (QVD);

DROP TABLE $(Tbl);

LET Tbl='';

LET Src='';

NEXT

Well, it does not fill the value, and run into error, that "unknown statement : LOAD * from;

I would appreciate for any help.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

You got the order within the peek function to be incorrect:

Try this:

Source:

LOAD t,

     s

FROM

[https://community.qlik.com/thread/167174]

(html, codepage is 1252, embedded labels, table is @1);

For i=0 to 3

  LET Tbl = PEEK('t',0,'Source');

  LET Src = PEEK('s',0,'Source');

  

  $(Tbl): LOAD * from $(Src);

  STORE $(Tbl) into $(Tbl).QVD (QVD);

  DROP TABLE $(Tbl);

  

  LET Tbl='';

  LET Src='';

NEXT

View solution in original post

3 Replies
sunny_talwar

You got the order within the peek function to be incorrect:

Try this:

Source:

LOAD t,

     s

FROM

[https://community.qlik.com/thread/167174]

(html, codepage is 1252, embedded labels, table is @1);

For i=0 to 3

  LET Tbl = PEEK('t',0,'Source');

  LET Src = PEEK('s',0,'Source');

  

  $(Tbl): LOAD * from $(Src);

  STORE $(Tbl) into $(Tbl).QVD (QVD);

  DROP TABLE $(Tbl);

  

  LET Tbl='';

  LET Src='';

NEXT

atsushi_saijo
Creator II
Creator II
Author

Yes you are right, and sorry for my mistake.

sunny_talwar

No problem my friend. I am glad we were able to pin-point it quickly.

Best,

Sunny