Multiple And expressions in Rule engine

Hello,

I am trying to find all of these values in one specific column. However, I only ever get missing values or my first instance which is Over. Am I missing something? I have tried the syntax below in both the Rule engine and the rule based row filter.

$bol_number$ = “OVER” AND $bol_number$ = “SHOP” AND $bol_number$ = “STOR” AND $bol_number$ = “COMP” AND $bol_number$ = “PLANT” AND $bol_number$ = “FLEET” AND $bol_number$ = “SCRAP” AND $bol_number$ = “NEW” AND $bol_number$ = “SWC” => TRUE

It looks like some of the items didn’t paste correctly but all of the italic labels above have wildcards (*) before and after the string.

Hi @Einayyar

Just a quick answer that may help. Not knowing the context, we can only guess what may be going wrong :wink:

Hence, my guess is that you have added wild chars “*” to italic words to ask for any occurrence of the word in the middle of a bigger sentence. If this is the case, you rather should use the comparator LIKE (and not the = comparator), for instance:

$bol_number$ LIKE  “*OVER*” AND $bol_number$ LIKE “*SHOP*” AND $bol_number$ LIKE “*STOR*” AND ... etc

The way you have written your condition is asking for having all these words inside the column cell
$bol_number$ string, whatever the order of the words. However, if what you want as condition is to check whether any of these words (not necessary all) are contained in the column cell $bol_number$ string, then rather use the operator OR (instead of AND).

But as I said, this is just a guess :wink:

Hope this helps.

Best

Ael

PS: To integrate code without being interpreted or transformed by the KNIME editor, rather use the </> option which preserves the formatting of copied and pasted code:

7 Likes

Hello!

Thank you that really helps and I was able to get the results I wanted!

2 Likes

Hi @Einayyar

Thanks for your kind comments and for validating the solution.

Best wishes with the rest :wink: of the work !

Ael

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