Qlik Community

QlikView Documents

Documents for QlikView related information.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.

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. [Smiley Wink]

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...
For tips on loading xls sheets with varying structures, see: http://qlikviewnotes.blogspot.com/2008/09/loading-multiple-excel-sheets.html
Not applicable
Hi, Thanks for posting such important post .
Not applicable

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

Thanks.

Jimmy

Not applicable

Hi, Thanks for posting.

Not applicable

thanks in advance for your share.

Not applicable

thanks for the great information.

Kind regards

Piskitta

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

avnish319
New Contributor

Its not loading multiple sheets from the same file!

Any suggestion?

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