[resolved] Greater than in tMap on BigDecimal

One Star

[resolved] Greater than in tMap on BigDecimal

Hi
I am trying to compare Big Decimal value and print Y or N based on the below condition. But syntactically it seems to be wrong with TALEND. Can someone please help me with correct syntax for below expression.
(row3.ATTRIB_03 == "100" && row3.ATTRIB_24 > BigDecimal.valueOf(0)) ? "Y" : "N"
row3.ATTRIB_03 is a String and row3.ATTRIB_24 is a BigDecimal and the expected output of this expression is a String.
Thanks
Kalyan

Accepted Solutions
One Star

Re: [resolved] Greater than in tMap on BigDecimal

Got answer for my question. I should be doing it in the following way:
(row3.ATTRIB_03 == "100" && row3.ATTRIB_24.compareTo(BigDecimal.valueOf(0)) == 1) ? "Y" : "N"

All Replies
One Star

Re: [resolved] Greater than in tMap on BigDecimal

What's error are you getting  ? 
One Star

Re: [resolved] Greater than in tMap on BigDecimal

Got answer for my question. I should be doing it in the following way:
(row3.ATTRIB_03 == "100" && row3.ATTRIB_24.compareTo(BigDecimal.valueOf(0)) == 1) ? "Y" : "N"