Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
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

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Load tables from path stored in a field table

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

Re: Load tables from path stored in a field table

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

Re: Load tables from path stored in a field table

Check this also

Loops in the Script