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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to read from subfolders?

Hi Colleagues,

I'm looking for some solution to ready multiple folders as data source (txt or excel)

Basically I need to create a load statement where I ready from all the folders below?

Folder 1\SubFolder 1

Folder 1\SubFolder 2

Folder 1\SubFolder 3

inside the folder I have a generif file name it means I should read all files with .xls extension

Thanks in advance,

Leandro Duarte

1 Solution

Accepted Solutions
whiteline
Master II
Master II

Hi.

Look at help, 'foreach' statement. There is an example.

View solution in original post

2 Replies
whiteline
Master II
Master II

Hi.

Look at help, 'foreach' statement. There is an example.

Not applicable
Author

Hi Leandro,

take a look at below script, this might help you.

SUB doDir (dir)

          FOR EACH file in filelist('$(dir)' &  '\*.qvw')

                         files:

                         LOAD

       x,

       y

       from xyz;

          NEXT

  FOR EACH subdir in dirlist( '$(dir)' & '\*' )

                      CALL doDir('$(subdir)')

          NEXT

END SUB

FOR EACH subdir in dirlist( '.' & '\*' )

  CALL doDir('$(subdir)')

NEXT

Regards,

Gaurav