Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
prma7799
Master III
Master III

How to load multiple tabs with one xls file

Hello All,

How to load multiple tabs with one xls file.

PFA...

10 Replies
arulsettu
Master III
Master III

prma7799
Master III
Master III
Author

Hi Arul,

I already tried this but i am getting error.

Thanks

arulsettu
Master III
Master III

what error

prma7799
Master III
Master III
Author

Cannot locate table in BIFF file

Concatenate(NPL)

LOAD * FROM

(biff, embedded labels, table is  [V 1] )

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Data:

LOAD RecNo() AS ID,

  [Inv Date],

     Month    

FROM

[NPL.xls]

(biff, embedded labels, table is V1$);

LEFT JOIN(Data)

LOAD RecNo() AS ID,

  Total,

     Apr,

     May

FROM

[NPL.xls]

(biff, embedded labels, table is V2$);

LEFT JOIN(Data)

LOAD RecNo() AS ID,

     Jun,

     Jul,

     Sep,

     Oct,

     Nov,

     Dec,

     Jan,

     Feb,

     Mar

FROM

[NPL.xls]

(biff, embedded labels, table is V3$);

Hope this helps you.

Regards,

jagan.

prma7799
Master III
Master III
Author

Hello Jagan,

This is again we are fetching data manually for all tabs.

We can't achieve  this in one load statements as you mention here Load Multiple excel sheets using For loop  ?

jagan
Luminary Alumni
Luminary Alumni

HI,

Try this script

LET vStartSheetNumber = 2;

LET vEndSheetNumber = 3;

Data:

LOAD RecNo() AS ID,

  [Inv Date],

     Month    

FROM

[NPL.xls]

(biff, embedded labels, table is V1$);

FOR index = vStartSheetNumber TO vEndSheetNumber

LEFT JOIN(Data)

LOAD RecNo() AS ID,

  *

FROM

[NPL.xls]

(biff, embedded labels, table is [V$(index)$]);

NEXT

prma7799
Master III
Master III
Author

again same error  come

annot locate table in BIFF file

NPL:

LOAD RecNo() AS ID,

  [Inv Date],

     Month   

FROM

(biff, embedded labels, table is V1$)

settu_periasamy
Master III
Master III

Hi,

Another One..

DIRECTORY;

LET vStartSheetNumber = 1;

LET vEndSheetNumber = 3;

LET vExcelFileName = 'NPL';

// Generate Empty table

NPL:

LOAD RecNo() as Key,

          '' AS [Inv Date],

  '' AS Month

AutoGenerate(0);

FOR index = vStartSheetNumber TO vEndSheetNumber

  if index=1 then

  JoinType='Concatenate'

  ELSE

     JoinType='Left Join'

    ENDIF

    $(JoinType)(NPL)

    LOAD RecNo() as Key,* FROM

    [$(vExcelFileName).xls](biff, embedded labels, table is V$(index)$);

NEXT