Replace from value of other column

Five Stars

Replace from value of other column

 

I'm starting using the Talend big data.

I wanna replace the nulls of one column by the value of the other?

It's this possible?

tReplace.PNG

Regards,

Vitor Sousa


Accepted Solutions
Thirteen Stars

Re: Replace from value of other column

you can do in tMap by writing below way.

 

row1.lname==null? row1.fname : row1.lname

Manohar B
Forteen Stars TRF
Forteen Stars

Re: Replace from value of other column

Hi,

Suppose the flow before your tReplace is called row74 (like in the following capture), you can refer to the desired column your want to get to replace "NULL" or null values in the source column.

Here, the target column is called newColumn1 and the source is newColumn.

This make the job:

Capture.PNG

In my example the input data are the following:

Capture.PNG

And the result is:


Capture.PNGHope this helps.


TRF

All Replies
Thirteen Stars

Re: Replace from value of other column

you can do in tMap by writing below way.

 

row1.lname==null? row1.fname : row1.lname

Manohar B
Five Stars

Re: Replace from value of other column

Thanks!
Forteen Stars TRF
Forteen Stars

Re: Replace from value of other column

Hi,

Suppose the flow before your tReplace is called row74 (like in the following capture), you can refer to the desired column your want to get to replace "NULL" or null values in the source column.

Here, the target column is called newColumn1 and the source is newColumn.

This make the job:

Capture.PNG

In my example the input data are the following:

Capture.PNG

And the result is:


Capture.PNGHope this helps.


TRF
Five Stars

Re: Replace from value of other column

I will try. But thanks for the help.