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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to load multiple sheets from an excel file

Hi ,

Can anyone please help me to load multiple sheets from an excel file.

I have an excel file with 16+ sheets and every week the number of sheets may vary. The sheet names are like 'Reseller master France','Reseller master Germany' etc and all sheet has same columns.

Is there any way to consolidate the data from all sheets.

Regards ,

Indu

3 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

If your file is in XLSX format, you can use SQLTables to build a list of sheets in your file, then loop through these.

ODBC CONNECT TO [Excel Files;DBQ=Your Excel File.xlsx];

//use SQLTables to assemble a list of all the sheets in this Excel file

XLSSheetList:

SQLTables

;

   

DISCONNECT; //from excel

for n = 0 to NoOfRows('XLSSheetList')

    LET vXLSXSheet = peek('TABLE_NAME', n, 'XLSSheetList');

    [Your Data]

    LOAD [your field list]

    FROM

    [Your Excel File.xlsx]

    (ooxml, no labels, table is '$(vXLSXSheet )');

next n

Not applicable
Author

Hi Marcus ,

Thank you so much for your help.

However when I am running the script I am getting the error

The following error occurred:

CONNECTs other than LIB CONNECT are not available in this script mode.

Could you please help.

Thanks in advance ,

Indu

marcus_malinow
Partner - Specialist III
Partner - Specialist III