Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load tables from path stored in a field table

Hi,

I have a table which contains all the tables path I want to load in an other single table.

this is my paths table

Path_table:

   LOAD

     FilePath,

   FROM path_table.qvd;

how I could do it?

thank you in advance

1 Solution

Accepted Solutions
maxgro
MVP
MVP

make a Qlik doc with this script in the same dir as the 3 .txt files attached

then reload; it will load the 3 .txt files in the FINAL_TABLE of the Qlik doc


DIRECTORY;

Path_table:

LOAD * inline [

FilePath

apr2015.txt

dec2014.txt

dec2015.txt

];   

STORE Path_table into Path_table.qvd (qvd);

DROP Table Path_table;

Path_table:

LOAD * from Path_table.qvd (qvd);

LET concat=' FINAL_TABLE: ';

FOR i=0 to NoOfRows('Path_table')-1

  LET file=Peek('FilePath', $(i), 'Path_table');

  //trace $(i);

  //trace $(file);

  $(concat)

  load * from $(file) (txt, codepage is 1252, no labels, delimiter is '\t', msq);

  LET concat = ' concatenate (FINAL_TABLE) ';

NEXT;

View solution in original post

2 Replies
maxgro
MVP
MVP

make a Qlik doc with this script in the same dir as the 3 .txt files attached

then reload; it will load the 3 .txt files in the FINAL_TABLE of the Qlik doc


DIRECTORY;

Path_table:

LOAD * inline [

FilePath

apr2015.txt

dec2014.txt

dec2015.txt

];   

STORE Path_table into Path_table.qvd (qvd);

DROP Table Path_table;

Path_table:

LOAD * from Path_table.qvd (qvd);

LET concat=' FINAL_TABLE: ';

FOR i=0 to NoOfRows('Path_table')-1

  LET file=Peek('FilePath', $(i), 'Path_table');

  //trace $(i);

  //trace $(file);

  $(concat)

  load * from $(file) (txt, codepage is 1252, no labels, delimiter is '\t', msq);

  LET concat = ' concatenate (FINAL_TABLE) ';

NEXT;

settu_periasamy
Master III
Master III

Check this also

Loops in the Script