Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
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!!!