Filtering rows with multiple words criteria

Hey Guys.

Sorry if I open a new thread but I didn’t find a solution to my problem in the old ones.

I’m trying to filter rows that contain in a specific column certain words. For example:
Lumaca, bergamoto, equiseto, etc.

The column contains sentences and the words I need to filter can be in different parts of the sentence (at the end or the beginning).

I tried to use the following rule in a ruled-base row filter node with no success:

$DESCRIZIONE ARTICOLO$ LIKE “Bergamotto” => TRUE
$DESCRIZIONE ARTICOLO$ LIKE “Equiseto” => TRUE
$DESCRIZIONE ARTICOLO$ LIKE “Lumaca” => TRUE

The workflow always returned a blank table. When I tried to substitute " with * then the syntax was wrong.

Can you guys help me?

Best Regards,
Giammarco

Hi @Giammarco_Neri

Welcome! You are close, but have a look at the description and the listed example of the LIKE function. The expression needs to be within quotes and with a wildcard pattern.

image

So if you use "*Bergamotto*" it will start to filter correctly :wink:

4 Likes

Hi @ArjenEX and thank you for your response.

I tried and now it works, I noticed that the nodes is case sensitive, so “BERGAMOTTO” and “Bergamotto” or “bergamotto” are three different values. Is there a way to eliminate the case sensitiviness?

Best,
Giammarco

2 Likes

Hi @Giammarco_Neri , you can create another column or replace existing column values with Upper case and then use it to filter the data. That would be easy. You can achieve this using String Manipulation node.

Also please mark @ArjenEX response as solution as it answers your primary question.

2 Likes

Take the risk and use ergamoto (judge for yourself if that works) , use an additional string manipulation as proposed or use Regex [Bb]ergamoto
br

1 Like

Ciao Daniel,

Thank you for your response, I like a lot your first solution, very creative :slight_smile: , however I am worried to miss out some records.

I am quite new with KNIME, can you show me an example of your 2nd Regex solution in the context of the rule-based row node.

Thank you

Ciao @kamtaot,

Thank you also for your answer, I will try also your suggestion.

Thank you,
Giammarco

@Giammarco_Neri
The rule based row filter does not support the case insensitive flag for regex (afaik)
so sth like

$column1$ MATCHES “.[Bb]ergamoto.” =>TRUE
would not capture BERGAMOTO
br

2 Likes

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