Qlik Community

QlikView Documents

Documents for QlikView related information.

Loading data from multiple xls-files from folder with subfolder

Not applicable

Loading data from multiple xls-files from folder with subfolder

This is code snippet is able to load a bunch of xls-files with the same data format but with different file-names, even perhaps with different sheet-names and located in a folder with subfolder(s).

It´s based on this thread from the archive. Thanks to the anonymous user. [;)]

SUB DoDir (Root)

FOR each File in filelist(Root& '\*.xls')

LOAD

value1,

value2,

value3

FROM [$(File)] (biff, embedded labels); //by leaving the part of naming the table it uses all tables of the file

NEXT File


FOR each Dir in dirlist (Root&'\*')

CALL DoDir(Dir)

NEXT Dir

END SUB

CALL DoDir('c:\test')

By modifying the code you will be able to load mutiple files in other file formats like csv and so on.

Labels (1)
Comments
Not applicable
Hi Thanks for your response... we are able load the data from xls files thru recursive logic. The problem is the count columns (Fields) will vary from xls sheet to xls sheet. Im looking for solution on this...
0 Likes
MVP & Luminary
MVP & Luminary
For tips on loading xls sheets with varying structures, see: http://qlikviewnotes.blogspot.com/2008/09/loading-multiple-excel-sheets.html
0 Likes
Not applicable
Hi, Thanks for posting such important post .
0 Likes
Not applicable

Hi, I need help how to load multiple Microsoft Access file (.mdb).

Thanks.

Jimmy

0 Likes
Not applicable

Hi, Thanks for posting.

0 Likes
Not applicable

thanks in advance for your share.

0 Likes
Not applicable

thanks for the great information.

Kind regards

Piskitta

0 Likes
nihalbuddy09
Contributor II

Hi, I am loading the data by your approach BUT in my case I want to add a date field (initially which is not in the table data) all I have a date and time stamp in the file name it self (ex: file_17.04.01_00.15).

Please help me to extract the date and time stamp from the file name and store it into a 'Date' field.


Thank you,

Nihal

0 Likes
avnish319
New Contributor II

Its not loading multiple sheets from the same file!

Any suggestion?

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2009-08-13 09:41 AM
Updated by: