Create Rule within Flow

I am trying to create a rule in my KNIME-flow that says, if X does not include “Y” then = 0.

Eg. If Name does not include “mr” then = 0. Can anyone help me?

Thank you! :slight_smile:

Hi Alberte.

I think simple Rule engine with NOT and LIKE operators can help you with your task.

Something like that:

NOT $name$ LIKE “mr” => 0

BR,
Alex.

Hi,

You can use a “Column Expressions” node and this expression to do that:
if(regexMatcher(column("column1"), "(?i).*mr.*")) 1
else 0

If any “mr” (case insensitive) is found then the output is 1, if not then the output is 0.
If you remove the (?i) from the expression it will be case sensitive.

Best,
Armin

3 Likes

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