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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] BigDecimal() and other functions 'missing' from Talend installation

Hi All,

I'm in the process of trouble shooting a data conversion issue, and have found many useful posts telling me how to convert a string to a BidDecimal, but they all use the BigDecimal function - this function doesn't appear in my Expression builder and then i try to write:

Math.BigDecimal(row1.totalNetRevenue)

I get an error saying that the method BiogDecimal doesn't exist.  I'm sure this is because i haven't installed something or checked a box somewhere, but i don't seem to be able to find an option for this.

Please Help,

Regards

Scott

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi rhall,

Thanks again for your reply.

I figured out where i needed to check that pesky box - under Window -> Preferences -> Java -> JUnit -> Add Class -> java.lang.math

FYI i am using Talend Open Studio 6.0.0.20150408_1742-M4, and Java 1.8.0_66.

It still doesnt appear under my functions list but at least when i do ctrl + <space> it appears so i can live with that!

Thanks Again,

Scott

View solution in original post

6 Replies
Anonymous
Not applicable
Author

BigDecimal is a Java class. It's in the package java.math. In Talend you should not need to use its full package name (java.math.BigDecimal), but you can if you want. The way you need to instantiate a BigDecimal object from the class is below.....

new BigDecimal(row1.totalNetRevenue)


....or...
new java.math.BigDecimal(row1.totalNetRevenue)
Anonymous
Not applicable
Author

Thanks for the quick response rhall.

When i type:

new BigDecimal(row1.totalNetRevenue)

into the Expression builder within the tMap component i get the error "the method BigDecimal(String) is undefined...".  I'm thinking i must need to load a java plugin somewhere to enable this function?

Regards

Scott
Anonymous
Not applicable
Author

That is interesting. Can you take a screenshot of the tMap configuration? Support for BigDecimal comes with Java as part of the basic package. So either something is wrong with your Java installation or something is wrong with your Talend install. What version are you using of both Talend and Java?
Anonymous
Not applicable
Author

Hi rhall,

Thanks again for your reply.

I figured out where i needed to check that pesky box - under Window -> Preferences -> Java -> JUnit -> Add Class -> java.lang.math

FYI i am using Talend Open Studio 6.0.0.20150408_1742-M4, and Java 1.8.0_66.

It still doesnt appear under my functions list but at least when i do ctrl + <space> it appears so i can live with that!

Thanks Again,

Scott
Anonymous
Not applicable
Author

BigDecimal is not a function, it is a class. Although the distinction might not seem important, it will help to understand the difference, especially when trying to resolve issues with Java errors. I always recommend that anyone working with Talend spends a bit of time learning Java. BlueJ is good for picking up the basics quickly (http://www.bluej.org/).
You should not need to configure Talend to use the BigDecimal class since it is a class that Talend supports out of the box. This suggests a potential bug in v6.0. Was this not working from a basic install or did you adjust any configuration settings before you found it didn't work? 
Anonymous
Not applicable
Author

This was the first job built in a clean install so perhaps its a bug...  Anyway your input was much appreciated!