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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to convert string (excel, csv) to string format "FW35 - 2018"

I need to convert a string in excel, csv format to a string output formatted as "FW35 - 2018" with fiscal year beginning 1/1/2018.

 

Input string format:  8/1/2018 7:59 (in excel, .csv format)

Output String format: FW35 - 2018 (FW=Fiscal Week, Fiscal Year begins 01/01/2018)

 

Any help or suggestions would be helpful. Thank you.

Labels (2)
2 Replies
Rajesh_Reddy1
Contributor
Contributor

TRY THIS

"FW"+

String.valueOf(TalendDate.getPartOfDate("WEEK_OF_YEAR",TalendDate.parseDate("MM/dd/yyyy", "8/1/2018 7:59")))
+" - " +
String.valueOf(TalendDate.getPartOfDate("YEAR",TalendDate.parseDate("MM/dd/yyyy", "8/1/2018 7:59")))

vapukov
Master II
Master II

generally - it not hard:

 

 

"FW"+String.valueOf(TalendDate.getPartOfDate("WEEK_OF_YEAR",raw1.dateCol))+" - "+String.valueOf(TalendDate.getPartOfDate("YEAR",raw1.dateCol))