Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sai_12
Contributor III
Contributor III

Load files from variables defined

Hello i am working on a task to improve the current load script for easy readability

we are loading the last 3 financial year files the files are named as follows

eg: Filename_year_2021

Let vFinPayCurrent = $(vMfinyr)&$(vMfinyr)+1; //Current Finpay
Let vFinPayLastYear = $(vMfinyr)-1&$(vMfinyr); //Last financial year
Let vFinPay2YrsAgo = $(vMfinyr)-2&$(vMfinyr)-1; //2 Financial Years ago

For loop to concat all these together,

Set vfilelist ='vFinPayCurrent','vFinPayLastYear','vFinPay2YrsAgo';
for each var in vfilelist
MyTable:
load *
FROM [$(vG.QVDPath)/Filename_year_$(var).qvd]
Next var

 

CURRENT Approach:

mytable:

load * from 

[$(vG.QVDPath)/Filename_year_$(vFinPayCurrent ).qvd]

concatenate

load * from 

[$(vG.QVDPath)/Filename_year_$(vFinPayLastYear ).qvd]

concatenate

load * from 

[$(vG.QVDPath)/Filename_year_$(vFinPay2YrsAgo ).qvd]

 

Thanks in advance

 

 

 

Labels (3)
1 Reply
Anil_Babu_Samineni

can you see in your variable section about output what is there for these 2 variables? (var, vfilelist )

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful