Skip to main content
Announcements
Document boards are being consolidated, this board no longer allows NEW documents READ MORE

Load Multiple excel sheets using For loop

cancel
Showing results for 
Search instead for 
Did you mean: 
jagan
Luminary Alumni
Luminary Alumni

Load Multiple excel sheets using For loop

Last Update:

Jul 30, 2013 3:58:58 AM

Updated By:

jagan

Created date:

Jul 30, 2013 3:58:58 AM

Hi All,

The script below loads the data into qlikview file for multiple sheets in a single load by using the Loop statements. 

LET vStartSheetNumber = 1;

LET vEndSheetNumber = 50;

LET vExcelFileName = 'Data';

// Generate Empty table

Data:

LOAD

          '' AS Data.Field1,

  '' AS Data.Field2

AutoGenerate(0);

FOR index = vStartSheetNumber TO vEndSheetNumber

     Concatenate(Data)

     LOAD

          *

     FROM [$(vExcelFileName).xlsx]

     (ooxml, embedded labels, header is 10 lines, table is [Page $(index)]);

NEXT

Note : in my excel file the sheet names are in the patter of Page 1, Page 2, ..... Page n.

Hope this helps others.

Regards,

Jagan.

Labels (1)
Comments
sasiparupudi1
Master III
Master III

It a bit confusing..are you saying that if the flag value is set then the next 2 below values of the indicator will become the numerator and denominators?

cos

20 and 30 are below 10  and 10 has flag set to 1

0 Likes
sasiparupudi1
Master III
Master III

It a bit confusing..are you saying that if the flag value is set then the next 2 below values of the indicator will become the numerator and denominators?

cos

20 and 30 are below 10  and 10 has flag set to 1

0 Likes
NickP_DF
Creator II
Creator II

Hello Jagan,

what about if a haven't a previous known number of tabs?

(I can't use the ODBC solution you posted)

Thks.

N.

rammuthiah
Creator III
Creator III
Hi,
I am getting this error, kindly help me with this.
There were no fields to load in the given source.
0 Likes
Version history
Last update:
‎2013-07-30 03:58 AM
Updated by: