How to run a rule engine without...

Hey all! I’m learning a lot about knime but there are things yet to learn.

How do I run a rule engine without “filter” the current results, I mean, besides the information I currently have on a column, I need to categorize another one, without “filtering” the previous one.

Thanks!

Hi @Yodata. Do you mean you to apply the Rule Engine to two different columns changing them? The Rule Engine only works on a single column, replacing or creating a new one even though your rule can be as complex as you need. Maybe the Column Expressions node might help, you need to install the Labs extension.

1 Like

Would you be able to provide an example of what you’re referring to? It’s not clear to me what exactly it is you’re asking.

Hi @Yodata , it’s not really clear to me either what you are trying to do.

What kind of filtering are you referring to? Can you show us a sample data and the logic you want to apply along with the expected results on the sample data?

I think that the answer is to use “if statements”, if I am interpreting your post correctly. You can use if statements on nodes that use similar rule engine syntax like “string manipulation” and “math formula” to change column values without filtering them first. I would encourage you to learn the column expression node syntax as well, as it is a far more universally powerful tool.

Column Expressions node is able to process mutiple columns

2 Likes

Thank you all.

I was trying to keep the values on a column, avoiding to be erasing by the new rule I was applying, finally I solved by testing the column itself with the expression:

$column$ = “Value1” => “Value1”
$column$ = “Value2” => “Value2”

Thanks to all!

Now that I understand what you were trying to do, a more universal solution is to simply end it with…

TRUE => $column$

That way it keeps all values in the column that do not match the above criteria equal to themselves.

The last “TRUE” functions more like a catch all of everything that did not match the above if statements tests.

I’m sorry. It’s a little bit hard for me to communicate in the right way. I appreciate your advice a lot! :smiley: will keep it for further.

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