Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Cyriltra
Contributor
Contributor

Load script For Each File

Hi,

i'm loading data from multiple excel file. Each Excel file is a different version (ie: a different date) of a forecast.

I'm using the filename to select the forecast version i want to analyze in qlikview.

Now i have a different file which contains my 2019 data that i want to concatenate to EACH file of my forecast. So when i select my forecast version, i can always compare with 2019 easily.

How should i proceed ?

right now i'm doing:

Data:
LOAD
filename() as filename,
[fields & FC metrics]
FROM
[C:\PATH\*.xlsx]
(ooxml, embedded labels, table is Sheet1)

For each File in filelist ('C:\PATH\')
Concatenate(Data)
LOAD
File.name as filename,
[fields & 2019 metrics]
FROM
[C:\ANOTHER PATH\2019 data.xlsx]
(ooxml, embedded labels, table is Sheet1);
Next File;

that does not work, any idea ?

I understand 2019 will be duplicate for each file and i'm ok with that.

Or maybe with using a "For Each File" statement, is there a way i can loop thru each filename loaded previously and then simply concatenate 2019 data and dynamically change filename ?

 

Thank you

Labels (2)
1 Reply
Bill_Britt
Former Employee
Former Employee

Hi,

Take a look at this QVW, it is pulling all files from the directory it is in.  This might help you with file gathering. 

 

Bill

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.