Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

MindaugasBacius
Valued Contributor II

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

Re: Load excel data from different sheet

See this example: Re: Loading Multiple Excel Files and Multiple Excel sheets


talk is cheap, supply exceeds demand
4 Replies

Re: Load excel data from different sheet

See this example: Re: Loading Multiple Excel Files and Multiple Excel sheets


talk is cheap, supply exceeds demand
sureshqv
Esteemed Contributor III

Re: Load excel data from different sheet

pj_julongbayan
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!

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
Community Browser