How to add a boolean column with two conditions on two other columns

Hello every body,
Please,
I have two int column ( A and B) full of 0 and 1 ( only those two values) and i would like to create a third (C) column with two conditions. If the row contain a 1 in A column and a 0 in the B column then the C column is fill with a 1, if it’s not the case ( A= 0 and B= 1 or A= 1 and B = 1), then fill the C column with a 0.

Thank you verry much in advance.

Hi @ThomasAmb33

This can be easily achieved using a -Rule Engine- node with the following rules:

$A$ = 1 AND $B$ = 0 => 1
TRUE => 0

In the node configuration you would need to chose to append a new column called C.
This should do the job.

Hope this helps.

Best
Ael

4 Likes

Thank you verry much Ael, It works perfectly fine, I’m struggling with simpl task i just discovered Knime.
Thank you verry much again.

1 Like

No problem at all @ThomasAmb33 and glad it worked. We are here to help, this is what we enjoy the most, I mean as much as playing with KNIME :wink: !

Enjoy KNIME and do not hesitate to ask again for help.

Best wishes,
Ael

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.