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

How to create a float by dividing two 'int's?

Hi,
I'd like to generate a calculated metric in my Talend job, namely a percent
At this point I have tried dividing two integer columns A / B in a tMap with the data type set to Float
I'm not getting decimal values through to my MySQL table; they're showing up as integers
My MySQL column is set to decimal data type length of '5,2'
I don't have a length specified in my Talend schema as I didn't know how to express it
Could use some help in getting my percentage working 0683p000009MACn.png
Thanks
Labels (2)
2 Replies
Anonymous
Not applicable
Author

Use (float) to convert your integer number division to float in tMap. say (float)(A/B). You already have your output column as float. So it should work.
Vaibhav
Anonymous
Not applicable
Author

Hi, and thanks 0683p000009MACn.png
I ended up just using the (float) on the first int, since that also works:
(float)row.col1/row.col2