Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
surajdhall
Contributor III
Contributor III

pick latest qvd

Hi All,

I want to load only the latest qvd file from the list. The qvd file has below format with timestamp.

qvd.JPG

From the above list, the latest file is 2nd one(File_01-12-2017_112912.qvd).

Please help!

5 Replies
Chanty4u
MVP
MVP

surajdhall
Contributor III
Contributor III
Author

Hi Chanty,

I checked this thread already, but coudn't get to the solution.

Could you please help me for my requirement.

Thanks!

jyothish8807
Master II
Master II

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

Best Regards,
KC
jyothish8807
Master II
Master II

Pfa sample i used

Br,

KC

Best Regards,
KC