Skip to main content
Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Aspiring_Developer
Creator III
Creator III

Load the latest year qvd from the folder into qlikview

Hello Everyone,

I am stuck on below.

I have below qvd files in the folder and i want to dynamically load the latest year qvd.(wish to load only 2020year qvd)

Aspiring_Developer_0-1605687083578.png

Tried below script:-

Let path_Pallet= '\\sdctwt0228\Sources\POAE\QVDs\Shopfloor\PPR\COPC_US83*.qvd' ;

for each File in filelist (path_Pallet)
AAA:
LOAD '$(File)' as FileName AutoGenerate 1;
next File

Tab:
LOAD MaxString(FileName) as lastFile Resident AAA;
LET myFile = Peek('lastFile', 0, 'Tab');
DROP Table AAA, Tab;

MyOnlyTable:
LOAD * From $(myFile);

exit script;

It is not giving me the right output

Aspiring_Developer_1-1605687236704.png

Can anyone please help ?

@Kushal_Chawda 

 

1 Solution

Accepted Solutions
MayilVahanan

Hi @Aspiring_Developer 

Try like below

Let vLastYear = Year(Today())-1;

Load * from

\\sdctwt0228\Sources\POAE\QVDs\Shopfloor\PPR\COPC_US83_$(vLastYear).qvd(qvd);

Hope it helps. 

If you want current year alone, change Year(Today())-1 to Year(Today()), its depends on ur requirement

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

1 Reply
MayilVahanan

Hi @Aspiring_Developer 

Try like below

Let vLastYear = Year(Today())-1;

Load * from

\\sdctwt0228\Sources\POAE\QVDs\Shopfloor\PPR\COPC_US83_$(vLastYear).qvd(qvd);

Hope it helps. 

If you want current year alone, change Year(Today())-1 to Year(Today()), its depends on ur requirement

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.