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 to integer in tmap.

I have input field row1.COMMON_PAR_VALUE in string format, but output field having type BigDecimal.
I want to convert this string datatype to respective output datatype.
I would try with following:
Integer.parseInt(row1.COMMON_PAR_VALUE)
and
Float.parseFloat(row1.COMMON_PAR_VALUE)
But above two expression gives error:
Exception in component tRowGenerator_1

Please help.
Labels (2)
3 Replies
Anonymous
Not applicable
Author

Hi,
Did you want to convert "String" to " BigDecimal" or "Integer"? If later, the Integer.parseInt(row1.COMMON_PAR_VALUE) should be och. If former, you should use
java.math.BigDecimal(row1.COMMON_PAR_VALUE)

.
Could you please upload your tMap setting screenshot into forum so that we can address your issue quickly.
Best regards
Sabrina
Anonymous
Not applicable
Author

hi all,
I suggest to use the tConvertType component for this.
https://help.talend.com/search/all?query=tConvertType&content-lang=en
regards
laurent
Anonymous
Not applicable
Author

Thanks for reply laurent.