Copy value from another cell, if the cell is empty

Hello,

I am new to KNIME and would like to know if KNIME is offering a solution for the following issue:

I have two list of coloures used on different days of the week ( one list for Monday and one list for Friday ). Some of colours used on Monday are not used on Friday, and some other that are used on Friday, are not used on Monday.

Table One:

Colour:     Day:     Colour_1:     Day_1:

Blue         Mon.      Blue            Friday

Green      Mon        Green         Friday

Red         Mon         ?                  ?

 

Table Two:

Colour:     Day:     Colour_1:     Day_1:

Blue         Mon.      Blue            Friday

Green      Mon        Green         Friday

?               ?             Yellow        Friday

 

My table after the join:

Colour:     Day:     Colour_1:     Day_1:

Blue         Mon.      Blue            Friday

Green      Mon        Green         Friday

?               ?             Yellow        Friday

Red         Mon         ?                  ?

 

What I need is a possibility to copy values from the column "Colour_1" to the column "Colour", if the column "Colour" is empty:

Colour:     Day:     Colour_1:     Day_1:

Blue         Mon.      Blue            Friday

Green      Mon        Green         Friday

Yellow      ?             Yellow        Friday

Red         Mon         ?                  ?

Is there any possibility to do so?

Thanks! 

Hi,

probably the 'Rule Engine'-node helps - with the following configuration:
Type in the expression field
'MISSING $Colour$ => $Colour_1$
TRUE => $Colour$
'
and select 'Replace Column: Colour'.

 

1 Like

Hi,

there is also a node for this: the column merger.

Cheers, Iris