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

looping through folder file

Dear all,

is it possible to loop through a folder and choose only the tables with a certain prefix name ?

for example, I would consider only the table with BUFFER_ as prefix name

Help please !1

Thanks in advance

1 Solution

Accepted Solutions
its_anandrjs

Load your script some thing like in location type like this BUFFER_*.xlsx if file name start with this only. By this all your tables load and concatenate with each other and make single table also if field name are same.

LOAD FieldName,

  FileBaseName() as FileName 

FROM

(ooxml, embedded labels, table is Sheet1);

Hope this helps

Thanks & Regards

View solution in original post

4 Replies
its_anandrjs

Load your script some thing like in location type like this BUFFER_*.xlsx if file name start with this only. By this all your tables load and concatenate with each other and make single table also if field name are same.

LOAD FieldName,

  FileBaseName() as FileName 

FROM

(ooxml, embedded labels, table is Sheet1);

Hope this helps

Thanks & Regards

maxgro
MVP
MVP

Directory;

FOR Each File in filelist ('.\BUFFER_*.xlsx')

  LOAD *

  FROM

  '$(File)'

  (ooxml, no labels, table is Sheet1);

NEXT File;

or

Directory;

LOAD *

FROM

BUFFER_*.xlsx

(ooxml, no labels, table is Sheet1);

Anonymous
Not applicable
Author

Thanks very much!!

Anonymous
Not applicable
Author

Thanks very much for your help