Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Rohitash
Contributor
Contributor

Converting DATE to String and String to Integer in TMAP

Hi All,

 

I have a small requirement, where multiple conversion is required

 

Scenario

 

I have date field name X_DT and it's Datatype is DATE and on the other end it has NUMBER Datatype. So how to convert it ?

 

First conversion should be on STRING Datatype and then it should converted into INTEGER Datatype.

 

Kindly assist.

 

Regards,

Rohitash Sherigar

Labels (2)
6 Replies
akumar2301
Creator III
Creator III

 

Integer.valueOf(TalendDate.formatDate("yyyyMMdd", row1.datecolumn))

 

 

Rohitash
Contributor
Contributor
Author

Thanks Abhishek for the assistant.

It's worked out really.

 

Could you please share the link of this function to write.Where I can reference it or future.

Rohitash
Contributor
Contributor
Author

Hi Abhishek,

 

I'm getting an java error. Please assist.

Please find attachment in the post.

 

Kindly reply.

Regards,

Rohitash 


ERROR_LOG.PNG
Rohitash
Contributor
Contributor
Author

Hi Abhishek,

 

As discussed my date format is in this form

DATE FORMAT : "yyyyMMddHHmmssSSS"

First i have to convert into string and then into number format.

 

So please suggest which datatype is suitable?

Float,Double, Integer or BigDecimal.

 

Please share the expression.

akumar2301
Creator III
Creator III

Try Long 

 

Long.valueOf(TalendDate.formatDate("yyyyMMddHHmmssSSS", new Date()))

 

If you want BigDecimal ,

 

new BigDecimal(TalendDate.formatDate("yyyyMMddHHmmssSSS", new Date()))