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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
xyz20
Contributor II
Contributor II

Automatic Loading of Excel Files form a folder connection through Script

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 fine 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
2 Replies
AndyC
Contributor III
Contributor III

I think You need to loop through each directory seperately. Try something along these lines....

FOR each fldr in DirList('lib://QS_Root/*')
 
TRACE Loading Folder: $(fldr);
    
FOR Each vFile IN FileList('$(fldr)\*.xlsx')
TRACE Loading File: $(vFile);
 
//LOAD * FROM [$(vFile)] (ooxml, embedded labels, header is 1 lines);
    
NEXT vFile
  
NEXT fld
Or
MVP
MVP

Is there some sort of logic to the names of the sheets and the contents thereof? You'll have to supply the former for QS to be able to do that, though you can skip the latter if you use Load *.