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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
xyz20
Contributor II
Contributor II

Automatic loading of Excel Files from a Folder

Hi. I have a folder connected to my Qlik Sense Enterprise cloud where i have placed multiple excel files. My excel files contain multiple sheets with each sheet has different data and different number of columns. The problem arises when i try to upload them automatically using the script. It only loads the first sheet and gives an error in loading other sheets. what should be included in script for load multiple sheets from an excel file?

Currently the load script which is working correctly to load single sheet file is below:

SET vFolderPath = 'lib://....*...*...';

FOR Each vFile IN FileList('$(vFolderPath)\*.xlsx')
TRACE Loading File: $(vFile);

  1. LOAD *
    FROM [$(vFile)] (ooxml, embedded labels, header is 1 lines);
    NEXT vFile
1 Reply
Ben_P
Creator II
Creator II

You need to add 'table is ', and then specify the sheet name. If you have multiple sheets, then create a variable and then loop through them. If your sheets are 'Sheet1', 'Sheet2', 'Sheet3' etc, then set the loop, and then within the loop create the variable (we could call it vSheetName) as 'Sheet' & loop number... then just reference that in your load statement:

FROM [$(vFile)] (ooxml, embedded labels, header is 1 lines, table is $(vSheetName));

This is the simple case, if you know the sheet names.