Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
josielaidlaw
Contributor II
Contributor II

loop to load multiple excel sheets

Hi! 

I have a folder on my computer, "Liefermenge," and in it, a folder "Quote." In the quote folder is a number of  different files, but I would like to create a loop to load only the ones that start with 0021... (ex. 0021_201901.xlsx, 0012_201902.xlsx, and so on). 

How would I go about doing this? I have read the questions similar to this, but I don't understand how to make a loop that selectively loads files from a folder.

I can't share any files, as I am working with Qlikview desktop.

Thanks in advance!

Labels (7)
2 Solutions

Accepted Solutions
Vegar
MVP
MVP

 

Data:
LOAD Field1, Field2, Measure1, Measure2 FROM [..\Quote\0012*.xlsx] (ooxml, embedded labels, table is Sheet1);

View solution in original post

hopkinsc
Partner - Specialist III
Partner - Specialist III

In the from clause at the end. So...

table1:
Load
Field 1,
Field2
Etc
>From path\0021*.xlsx;

View solution in original post

6 Replies
Vegar
MVP
MVP

The absolute easiest way to accomplish this is to fetch QlikView component library and use the qvc.listfiles SUB.

https://github.com/RobWunderlich/Qlikview-Components
hopkinsc
Partner - Specialist III
Partner - Specialist III

Are the field names the same in each? if so, can't you just use a wildcard?

eg

 

From 0021*.xlsx

josielaidlaw
Contributor II
Contributor II
Author

Yes, all the field names are the same. 

Where would I put this statement? 

Vegar
MVP
MVP

 

Data:
LOAD Field1, Field2, Measure1, Measure2 FROM [..\Quote\0012*.xlsx] (ooxml, embedded labels, table is Sheet1);
hopkinsc
Partner - Specialist III
Partner - Specialist III

In the from clause at the end. So...

table1:
Load
Field 1,
Field2
Etc
>From path\0021*.xlsx;

josielaidlaw
Contributor II
Contributor II
Author

Thank you!!!