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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
DEV4
Contributor III
Contributor III

< operator throwing error in tmap

Hello All,

I have a scenario where Im using less than (<) operator and getting below error. Can you please help me how to handle this.

 

Logic I used in tmap:

row1.newColumn.subtract(row2.newColumn) < new BigDecimal(0) ? new BigDecimal(0) : row1.newColumn.subtract(row2.newColumn)

 

Below is the error:

The operator < is undefined for the argument type(s) java.math.BigDecimal, java.math.BigDecimal

 

Please help me how to handle this scenario.

 

Thanks

Labels (5)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

You need to use BigDecimal.compareTo() to compare BigDecimal values

View solution in original post

2 Replies
TRF
Champion II
Champion II

You need to use BigDecimal.compareTo() to compare BigDecimal values
DEV4
Contributor III
Contributor III
Author

Thanks TRF. That worked.