Rule engine

Good afternoon everyone, how are you?

I have column 2 and column 3, I would need that when column 3 is the same as it did it says column 2 if not it says column 2 & “=>” & column 3, can you help me?

Hard to tell exactly what you are trying to do. Does this look like what you are aiming at?
KNIME_project3.knwf (11.4 KB)

Basically if column 2 and column3 are the same, it results column 2, else it combines column2 with “=>” with column3.

The second column expressions node also includes a test for missing values in column 3 in case that is relevant to your output.

1 Like

following this same context that you passed but only changes the calculation.

If column 3 = null say column 2.

if column 3 is different from null say column 2 +“=>”+column 3

I edited my above post after a re-read just as you were writing. Open it again as I included that as a second option.

I needed to remove only the case that is equal, because even if it is equal, it needs to do column 2 +“=>”+column 3, because column 3 will be different from null, can you help me with that?

KNIME_project3.knwf (11.8 KB)

I kept the second one in as well, but the top expression node only tests for a missing value in column 3.

The second one also tests if the values are the same in case you want to avoid showing values changing to themselves. “value1=>value1”

KNIME_project3.knwf (10.9 KB)

Here it is the other way just to be safe as well.

if (column(“column2”)==column(“column3”)) {column(“column2”)}
else {column(“column2”)+“=>”+column(“column3”)}

I had used an OR statement in that Missing values test in previous posts, so it would have still functioned as you needed. It would only have served as a precaution for missing values in the future. There appeared to be missing values in your original screenshot, so I included it for you.