if X= A or B and Y <# then Rule engine node help

Hi
I want to write this statement on Rule Engine or another node can you please help.
if a condition is “Moderate” or " Cool” and temperature is <30 then on the new column put " Convenient"
for the rest “Inconvenient”
Note: Condition and temperature are existing columns on my table with data and I wan to create a new column that depends on these two columns.
Thank you

You can do this with Rule Engine node just as you wrote it :slight_smile:
$Condition$ IN (“Moderate”,“Cool”) AND $temperature$ < 30 => Convenient
$temperature$ >= 30 => Inconvenient

Check append column and add a name.

BR,
Ivan

1 Like

You should be able to do this in the rule engine node (https://nodepit.com/node/org.knime.base.node.rules.engine.RuleEngineNodeFactory) with e.g.

$Temperature$ < 30 AND $Condition$ IN ("Moderate", "Cool")  => "Convenient"
// All other cases...
TRUE =>"Inconvenent"

Steve

4 Likes

If (X = A or X = B) and Y < 30 => “Convinient”
If Not (X= A or X= B) OR Y >=30 => “Inconvinient”

TRUE is convenient to use in Rule engine Node :wink:

2 Likes

Thank you very much everyone, it woked well.

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