how to use compareTo in tmap. Getting error while converting int to bigdecimal

Highlighted
Five Stars

how to use compareTo in tmap. Getting error while converting int to bigdecimal

Hi,

I am getting an error while converting int to bigdecimal so am not able to use compareTo operator. Please help  to get rid of it. Please refer below e.g.

row1.Dest_NBR.compareTo(BigDicimal(-1))
Error : The method BigDecimal(int) is undefined for the type

 


Accepted Solutions
Forteen Stars

Re: how to use compareTo in tmap. Getting error while converting int to bigdecimal

@rohit1804 ,if row1.Dest_NBR  column is big decimal then it will work below way to filter the data.

 

 

row1.Dest_NBR==new BigDecimal("-1")

 

if is it sting means convert below way.

 

new BigDecimal(row1.Dest_NBR.equals("-1))

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

All Replies
Forteen Stars

Re: how to use compareTo in tmap. Getting error while converting int to bigdecimal

@rohit1804 ,what is the data type of row1.Dest_NBR column?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Forteen Stars

Re: how to use compareTo in tmap. Getting error while converting int to bigdecimal

@rohit1804 ,if row1.Dest_NBR  column is big decimal then it will work below way to filter the data.

 

 

row1.Dest_NBR==new BigDecimal("-1")

 

if is it sting means convert below way.

 

new BigDecimal(row1.Dest_NBR.equals("-1))

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog