Load Multiple excel sheets using For loop

    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.