Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

load multiple excel files with for loop

Hello,

I have five excel sheets with different column names. I want to load this with a for loop(without load data with 'table files': is this possible?).

The names of the files are: file1, file2, file3, file4 and file5.

I have found this script:

FOR a=1 to 5

LOAD * FROM C:\Users\name\Documents\Qlikview\script\file$(a).xls;

NEXT

FOR counter=1 to 5 step 2

SET filename=x$(counter).xls;

IF rand( )<0.5 THEN

EXIT For Unless counter=1

END IF

LOAD * FROM $(filename);

NEXT

But I get the error: cannot find: LOAD * FROM x1.xls.

Can someone help me? What is wrong?

thanks in advance.

4 Replies
Not applicable
Author

Hi Maichel,

Could you please explain this query little bit.

Did not get what exactly you are looking for

Regards

Anonymous
Not applicable
Author

No need for a loop, just

LOAD * FROM C:\Users\name\Documents\Qlikview\script\file*.xls;

Anonymous
Not applicable
Author

use the script Editor and load one of the files using wizard.

in your load LOAD * FROM C:\Users\name\Documents\Qlikview\script\file$(a).xls;

the tab is missing from which Qlikview should load

d_koti24
Creator II
Creator II

Hi,

Go Through This link,it will help you

Loading from multiple Excel files and multiple sheets

Regards,