I am trying to write a rule using the rules engine with multiple columns to replace column.
$DRIVE_NUMBER$ = “1” AND $DISTANCE$ = “10” AND $DOWN$ = “1” => “P”
I am trying to replace rows in the $DOWN$ column that contain “1” with “P”. YES, it worked but NOW all of the other ROWS in the $DOWN$ column now contain a ?.
Does anyone have any suggestions?
Thanks in advance.
When you create a rule in the rule engine node, the node will execute that single rule. If there are rows that do not accept that rule or do not comply to that rule, they will become missing values (the ? you mentioned) unless you explicitly say what value they should take. Because you have rows that do not follow the rule you created ($DRIVE_NUMBER$ = “1” AND $DISTANCE$ = “10” AND $DOWN$ = “1” => “P”) KNIME then attributes a missing value for them.
If you want that all rows that are not “P” become “Q”, for instance, you could add the following rule:
TRUE => “P”
This is the same as to say “anything else that does not obey my rule should become Q”.
But this is just one of the ways, and as said before by pawanmtm-- multiple ways lead to Rome in KNIME.
@ana_ved Thanks for the feedback. I applied your logic and it worked.
Ok, so how would I create a rule that says
“anything else that does not obey my rule should NOT change” OR another way of saying it
“anything else that does not obey my rule should KEEP its original value”