Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Aldemarprins4
Contributor III
Contributor III

For for multiple Excel files

Hello guys, I have the following case:

I have several excel files that I want to upload to Qliksense but I want to upload them without the *

The File has the date for example: 202301, I currently loads with 2023* but I would like to know if there is a possibility to replace the * by a variable that auto-increments and reads the files that are available

Thank you

1 Solution

Accepted Solutions
tealowk
Partner - Contributor III
Partner - Contributor III

Hi,

you can include your load statement inside a loop which loops through the months you want to load. At the end of each iteration, the vPeriod-variable is increased by 1 using the AddMonths() function.

For example: 

set vPeriod = 202301;

for i = 1 to 12

    load
        Field1,
        Field2
    from [lib://AttachedFiles/Report $(vPeriod).xlsx]
    (ooxml, embedded labels, table is Report);

    let vPeriod = date(addmonths(date#($(vPeriod), 'YYYYMM'), 1), 'YYYYMM');

next

Hope that helps.

 

Kind regards from Brussels,

Thilo

View solution in original post

2 Replies
tealowk
Partner - Contributor III
Partner - Contributor III

Hi,

you can include your load statement inside a loop which loops through the months you want to load. At the end of each iteration, the vPeriod-variable is increased by 1 using the AddMonths() function.

For example: 

set vPeriod = 202301;

for i = 1 to 12

    load
        Field1,
        Field2
    from [lib://AttachedFiles/Report $(vPeriod).xlsx]
    (ooxml, embedded labels, table is Report);

    let vPeriod = date(addmonths(date#($(vPeriod), 'YYYYMM'), 1), 'YYYYMM');

next

Hope that helps.

 

Kind regards from Brussels,

Thilo

Aldemarprins4
Contributor III
Contributor III
Author

thanks