Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Valued Contributor III

Load excel data from different sheet

Hei,

I manage to load information from all excel files in folder by using this script:

SUB DoDir(Root) 

 

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

    LOAD @1,   

         @2 

    FROM 

    [$(File)] 

    (biff, no labels, table is Sheet1$); 

NEXT File 

 

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

     CALL DoDir(Dir) 

NEXT Dir 

 

END SUB  

 

CALL DoDir('C:\Users\Mindaugasb\Desktop\Orders\2016') 

Now how should I change the script to load information from different sheets in the files?

Thank you!

Tags (1)
1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Load excel data from different sheet

4 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Load excel data from different sheet

Highlighted
Esteemed Contributor III

Re: Load excel data from different sheet

Highlighted
New Contributor

Re: Load excel data from different sheet

Hi Gysbert,

How do I modify the code you provided in the link when I have no connection nor SQL installed? I tried using the same code and disabling the line about SQL. It loads all .xlsx files with the proper filename but the sheetname cannot be extracted. Thanks!

Highlighted
MVP & Luminary
MVP & Luminary

Re: Load excel data from different sheet

You don't need to install an SQL database management system. But you do need the odbc driver for excel files. The sqltables command is passed to and execute by the odbc driver to get the list of sheetnames from the excel file.


talk is cheap, supply exceeds demand