Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)
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
Can anyone please help ?
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
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