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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

load files with a loop

hello guys,

I search the forums for an example but I didn't find one.

I have a directory ( named C:\test ) which contains 3 XLS files named ACT1,ACT2,ACT3.

All 3 files are in the same structure.

All I want is to build a loop which will run 3 times and will load the files.

How can I do that?

What is the correct syntax ?

Thanx a lot!

David

1 Solution

Accepted Solutions
Not applicable
Author

Hi David,

you can use a wild card:

Load

Field1,

Field2,

Field3

FROM ACT*.xls (biff, embedded labels, table is Tabelle1$);

Good luck!

Rainer

View solution in original post

4 Replies
Not applicable
Author

Hi David,

you can use a wild card:

Load

Field1,

Field2,

Field3

FROM ACT*.xls (biff, embedded labels, table is Tabelle1$);

Good luck!

Rainer

Not applicable
Author

Hi David,

Here is an example that loads a spreadsheet with multiple sheets. The theory should also work for what you want to do.


SET vPath=C:\Training\;
for vSheetName = 2005 to 2009
"BUDGETS":
LOAD
EmployeeID,
$(vSheetName) AS BUDGETYEAR,
Budget as BUADGETAMOUNT
FROM [$(vPath)\Datasources\Budget.xls] (biff, embedded labels, table is [$(vSheetName)$],FILTERS(REPLACE(1,TOP,STRCND(NULL))));
next


Regards,

Werner

Not applicable
Author

Great (and really quick) solutions!

10X guys Big Smile

Not applicable
Author

A really simple example of a loop:

For I = 1 to 3

LOAD F1,
F2,
F3
FROM

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

Next I