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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Trouble concatenate a String + Date + Date

Hello,
I am trying to concatenate 3 input fields together. One is a string field and the other two are date fields.
My Input fields are as follows:
Selic Code = 100000
Issue Date = 20060804
Maturity Date = 20080401
Below is my expression in tMap:
("YMF")+("=")+(row2.Selic_Code)+("_")+(row2.Issue_Date)+("_")+(row2.Maturity_Date)+("=")
The Output Talend gives me is:
YMF=100000_Fri Aug 04 00:00:00 CDT 2006_Tue Apr 01 00:00:00 CDT 2008=
The Output I want to get is:
YMF=100000_20060804_20080401=
Can anyone help me correct this expression?
Thanks in advance,
David
Labels (2)
5 Replies
Anonymous
Not applicable
Author

what is the format of your fields Issue Date & Maturity Date? String or date?
Anonymous
Not applicable
Author

Date, both have a Date Pattern of "yyyyMMdd"
Anonymous
Not applicable
Author

try this in your tMap:
("YMF")+("=")+(row2.Selic_Code)+("_")+(TalendDate.formatDate("yyyyMMdd",row2.Issue_Date))+("_")+(TalendDate.formatDate("yyyyMMdd",row2.Maturity_Date))+("=")
Anonymous
Not applicable
Author

Yes that worked, Thanks!
Anonymous
Not applicable
Author

you'll welcome