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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get latest files

How to get the latest file. when we run history. Can anyone please help to sort it out.

Labels (2)
16 Replies
TRF
Champion II
Champion II

Add the following in the tJava component Advanced settings:

import java.math.*;
manodwhb
Champion II
Champion II

did you try my solution?

Anonymous
Not applicable
Author

Thanks for your support

Actually I was confused, I tried but didn't understand 

manodwhb
Champion II
Champion II

1) in tjava put below code.

String pattern_suffixe = "*.csv";

globalMap.put("yyyyMMdd", TalendDate.getDate("yyyy_MM_dd"));

globalMap.put("pattern", "Customersdata_"+ TalendDate.getDate("yyyyMMdd") + pattern_suffixe);

2) in tFilelist use the below parameter under the filemask.same which i have provided in screenshot in the first reply.

((String)globalMap.get("pattern"))

 

manodwhb
Champion II
Champion II

is my solution usefull?

TRF
Champion II
Champion II

Finally you will be able to get the file with using the variable "lastFile" as a filename:

0683p000009LsVi.png

Now you got a complete solution for your case.

Don't forget to mark it as solved (Kudos also accepted).

Anonymous
Not applicable
Author

Hi ,

 

Thanks for your support, I will accept your solution.

I found one simple way to get the latest file.

In tfilelist  we have by filename instead of default and order by des.

Then we will get latest file.

 

Thanks