Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

One LOAD statement from two sheets in same Excel Workbook

Hi,

I'm trying to figure out how to load data (with the same format and headers) from two tabs in Excel, "Incoming" and "Outgoing".

Can I state the two sheets in the FROM statement maybe?

Any ideas?

Kind Regards,

Olle


1 Solution

Accepted Solutions
Partner
Partner

Re: One LOAD statement from two sheets in same Excel Workbook

Hi,

You can do a for each loop like

for each vSheet in 'Incoming', 'Outgoing'

  MY_TABLE

  LOAD

    *

  FROM XL.xls (biff, embedded labels, table is [$(vSheet)])

;

NEXT vSheet

(I think that work )

Aurélien

5 Replies

Re: One LOAD statement from two sheets in same Excel Workbook

You must load them one by one with 2 loads or in a for next loop

alkesh_sharma
Contributor III

Re: One LOAD statement from two sheets in same Excel Workbook

IF your sheet name is sheet1 and sheet2 (Numerically Ascending), you can achieve it using loop. but if the sheets have completely independent name like 'East' and 'West' then you have to load them separately.

Highlighted
Employee
Employee

Re: One LOAD statement from two sheets in same Excel Workbook

Hi Olle,

If you are using the Table Files... wizard to import data then you need to use the "Tables" drop down on the first screen of the wizard to select which sheet to import.

If the fields are identical between sheets then you can copy an existing load statement and change the sheet name manually (find the "table is @tablename").

If you have multiple identical sheets, or sheets are dynamically added then a loop might become more efficient, but this can be more complex to set up.

Partner
Partner

Re: One LOAD statement from two sheets in same Excel Workbook

Hi,

You can do a for each loop like

for each vSheet in 'Incoming', 'Outgoing'

  MY_TABLE

  LOAD

    *

  FROM XL.xls (biff, embedded labels, table is [$(vSheet)])

;

NEXT vSheet

(I think that work )

Aurélien

Not applicable

Re: One LOAD statement from two sheets in same Excel Workbook

Perfect! Thanks a lot.

Works like a charm. A bit slower than two separate LOADS for som reason but works great for my purpose.

Kind Regards,

Olle