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

Tmap expression output isnt whats expected (even from tester)

Hello I have the following expression and when I have  Min and Max == or != to each other in the tester, I get "Exception in thread "main" java.lang.Error: Unresolved compilation problems:"

 

SET_VALUES.AddrMin == SET_VALUES.AddrMax ? null
: SET_VALUES.AddrMin != SET_VALUES.AddrMax ? SET_VALUES.Count + SET_VALUES.ModuleWidth
:null

 

However, When I run my job anyway, my results show that is works when Min != Max (it does the calculation properally)  However, it doesn't set the output to null if the min == max. Please help!

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I ended up changing the data type to Big Decimal and then the following expression worked. For some reason, adding doubles doesn't work very consistently. Thanks!

 

row6.AddrMin.equals(row6.AddrMax) ? null
: row6.AddrMin.add(row6.MinW)

View solution in original post

5 Replies
manodwhb
Champion II
Champion II

@dutch070 ,you need to change the expression below way. this will work check this.

SET_VALUES.AddrMin != SET_VALUES.AddrMax ? SET_VALUES.Count + SET_VALUES.ModuleWidth
:null

manodwhb
Champion II
Champion II

@dutch070 ,input column data type should be integer.0683p000009M2at.png0683p000009M2ez.png

Anonymous
Not applicable
Author

So It has to be at least a decimal for me because my data set has them. I have it set as datatype double. Math should still work out the same though right?

I tried both expressions and neither worked. for me.


Talend Help.png
Anonymous
Not applicable
Author

Here Is a screen shot of my Tmap.


Talend Help2.png
Anonymous
Not applicable
Author

I ended up changing the data type to Big Decimal and then the following expression worked. For some reason, adding doubles doesn't work very consistently. Thanks!

 

row6.AddrMin.equals(row6.AddrMax) ? null
: row6.AddrMin.add(row6.MinW)