Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
You must load them one by one with 2 loads or in a for next loop
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.
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.
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
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