Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to load only the latest qvd file from the list. The qvd file has below format with timestamp.
From the above list, the latest file is 2nd one(File_01-12-2017_112912.qvd).
Please help!
try this
Hi Chanty,
I checked this thread already, but coudn't get to the solution.
Could you please help me for my requirement.
Thanks!
Hi Suraj,
Try this:
B:
LOAD date(date#(subfield(replace(REPLACE(filename(),'.xlsx',''),'File_',''),'_',1),'DD-MM-YYYY'),'DD-MM-YYYY') as filename1,
num(subfield(replace(REPLACE(filename(),'.xlsx',''),'File_',''),'_',2)) as Filename2
FROM
(ooxml, no labels, table is Sheet1);
B1:
Load
date(max(filename1),'DD-MM-YYYY') as MaxDate
resident B;
Let vMaxDate= Peek('MaxDate',0,'B1');
Drop table B1;
C:
Load
filename1,
max(Filename2) as MaxCount
resident B
where match(filename1,'$(vMaxDate)')
Group by filename1;
Let vMaxCount= Peek('MaxCount',0,'C');
Filnal:
Load
*
from
[File_$(vMaxDate)_$(vMaxCount).xlsx]
(ooxml, no labels, table is Sheet1);
drop table B;
Note: Replace .xlsx with qvd and modify the from statement. I did it using .xlsx file.
Br,
KC
Pfa sample i used
Br,
KC