Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load data from multiple excel files with multiple excel sheets

Hi

The following question is from the thread:

Load Multiple excel sheets using For loop

I have been trying to figure out a way to only load new files by using this script. After a lot of trial and error I came up with the script below. This works for all files except for the last, i.e. it loads through all the files without adding any data but it does load data from the last file even though it should not.

the MaxsystemTime used below is derived from a timestamp on one of the sheets in the excel files, i..e it does not exist on all sheets which stops me from using it in the WHERE clause (I think....)

NewData:

LOAD

  '' AS Data.Field1,

  '' AS Data.Field2

AutoGenerate(0);

FOR index = vStartSheetNumber TO vEndSheetNumber

Set ErrorMode = 0;

Concatenate(NewData)

LOAD

          *

FROM C:\Temp\Qlik\Data*.xlsx

(ooxml, embedded labels, table is [Datasheet$(index)])

WHERE Filetime() > '$(MaxSystemTime)';

NEXT




Any ideas or alternate ways of only loading new data while loading from Mlutiple sheets?

0 Replies