How can you compare integer columns from same table in Talend data integration components

Six Stars

How can you compare integer columns from same table in Talend data integration components

 
Four Stars act
Four Stars

Re: How can you compare integer columns from same table in Talend data integration components

Hi! An expression in a tMap could generally do, but there are many different ways in Talend to achieve a comparison between fields of a same table, depending on the action you want to take.

Can you describe what you need to do?

Six Stars

Re: How can you compare integer columns from same table in Talend data integration components

I didn't found any function where you can compare columns from same table.

Logic.

if (col A > col B and col A > col C then col A, if col B > col A and col B > col C  then col B , col C).

how to achieve this in tmap?. 


@act wrote:

Hi! An expression in a tMap could generally do, but there are many different ways in Talend to achieve a comparison between fields of a same table, depending on the action you want to take.

Can you describe what you need to do?


 

Four Stars act
Four Stars

Re: How can you compare integer columns from same table in Talend data integration components

is it the the max value of col A, col B, col C you want?

you can do this with the function Math.max if you fields are integer.

 

if not  you can use the ternary operator  ? :

 

exp1 ? exp 2 : exp 3

will return exp 2  if expression exp 1 is true, exp 3 if not

 

in your case you would need two nested operations:

col A >= col B  && col A >= col C ? col A :

 col B >= col A && col B >= col C ? col B : col C

 

 

 

 

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

Enabling Data Governance

Learn how to enable Data Governance

Watch Now

The Definitive Guide to Government Data Quality

Take a peek at the definitive guide to Government Data Quality

Read