Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Tags (1)
1 Solution

Accepted Solutions
whiteline
Honored Contributor II

Re: How to read from subfolders?

Hi.

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

2 Replies
whiteline
Honored Contributor II

Re: How to read from subfolders?

Hi.

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

Highlighted
Not applicable

Re: How to read from subfolders?

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

Community Browser