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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

get FILE NAME and current date

Hello,

 

is it possible to extracte only the file name and not the directory?

Currentyl  I tried ((String)globalMap.get("tFileOutputDelimited_1_FILE_NAME")), which gives the whole path and not only the desired file name.

 

And is it possible to get the current date formatted like this "24-Oct-2019"? 

Currently I am using TalendDate.getDate("yyyyMMdd"), which obviously creates "20191024"

 

Thank you very much!

 

Regards

Fred

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Ok, I mxed up getDate and getCurrentDate.

 

Now it works:

TalendDate.formatDateLocale("dd-MMM-yyyy",TalendDate.getCurrentDate(),"EN")

 

Thanks!

 

View solution in original post

3 Replies
manodwhb
Champion II
Champion II

@fred123 ,to get the only file name you need to do in tjava with ((String)globalMap.get("tFileOutputDelimited_1_FILE_NAME")) of sub-string function.

 

 

TalendDate.getDate("dd-Mon-yyyy") can you try this.

Anonymous
Not applicable
Author

Hey thanks for the reply,

 

"Mon" doesn't work but TalendDate.getDate("dd-MMM-yyyy") generated nearly what I'm look for:

"24-Okt-2019"

Now I need the english value for month --> "Oct"

I tried TalendDate.formatDateLocale("MMM",TalendDate.getDate("dd-MMM-yyyy"),"EN")

 

The method formatDateLocale(String, Date, String) in the type TalendDate is not applicable for the arguments (String, String, String)

 

What am I missing? Why is TalendDate.getDate("dd-MMM-yyyy") a String argument?

 

Thanks!

Anonymous
Not applicable
Author

Ok, I mxed up getDate and getCurrentDate.

 

Now it works:

TalendDate.formatDateLocale("dd-MMM-yyyy",TalendDate.getCurrentDate(),"EN")

 

Thanks!