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

Null Pointer Exception BigDecimal

Hey there,

 

I want to use this here:

 

(row5.SUMJHR ! = null ? row5.SUMJHR.toPlainString() : row5.SUMJHR)

 

talend gets me the error: "Type mismatch: cannot convert from Object&Serialzable&Comparable<?> to String"

 

Any Idea? The input row is BigDecimal.

 

Thanks a lot!

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I got the solution:

 

row5.SUMJHR == null ? null : row5.SUMJHR.toPlainString()

View solution in original post

7 Replies
Anonymous
Not applicable
Author

You need to give me more info. For example, what is the field type that this is setting. I am assuming it is String. However, a quick solution might just be this....

 

(row5.SUMJHR ! = null ? row5.SUMJHR.toPlainString() : null)
Anonymous
Not applicable
Author

(row5.SUMJHR ! = null ? row5.SUMJHR.toPlainString() : row5.SUMJHR)

 

i think your expression is wrong. Use this:

(row5.SUMJHR ! = null)? row5.SUMJHR.toPlainString() : row5.SUMJHR

 

Be sure that your output is a String type

 

SGV

 

 

Anonymous
Not applicable
Author

@sgv there is no difference between those two expressions. The brackets do nothing

Anonymous
Not applicable
Author

I got the solution:

 

row5.SUMJHR == null ? null : row5.SUMJHR.toPlainString()

Anonymous
Not applicable
Author

I just tested ! You're right 😃
Anonymous
Not applicable
Author

That is what I suggested

Anonymous
Not applicable
Author

Hello,

Please mark solution as accepted if it is OK with you question.

Best regard

Sabrina