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 convert object datatype to bigdecimal/double

I am using source as ms sql in talend big data version. There is data type as Money. While fetching schema from db. The data type changed to object. Now I need to convert it to BigDecimal or Double in tmap. I Tried to use new Bigdecimal(column name).But Its not working.


Thanks in advance.

Labels (3)
1 Reply
Anonymous
Not applicable
Author

Can you try to set the schema in your MSSQL component to Big Decimal there so that it retrieves it as a big decimal?  

If not, then you need to understand what the object contains first.  If it is a String, then you can cast the object to a String first like:

 

new BigDecima((String)columnname)

 

See the BigDecimal constructors here https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html  

There is no constructor for generic Object type.  Hence, you will need to know what is in the Object and cast accordingly.