Help with rule-based row filter

Good morning first of all :slight_smile:

I need help with my knime, lets see if i can get it. Table 1 (image) is the main table and then i have several secondary tables, each one for concrete products (image):

In main table, the “ids” colum are all the products concatenated that the ticket have.

So what im trying after one reader node for each table, and a joiner is to filter the rows with a rule-based row filter and the next command: $product_id$ LIKE “$ids$” => TRUE but its not working, doest find matches, maybe is because of the “ids table” format?

Thanks in advance!

Ho @Alfonsoab

Can you upload (part of) your workflow, along with input data? It makes it much easier to actually see what the struggle is, and which solution fits best.

gr. Hans

2 Likes

Ofcourse @HansS !

This is the data of the node before the rule-based row filter:

what i want is to filter looking for the content of column J in column D and just let pass the ones that match.

Thanks for the screenshot - as per Hans request: Can you upload the workflow that you are currently working on - ideally with anonymised data that is similar to what you face in reality?

It is really hard to help you if one has to manually re-create the data based on a screenshot…

1 Like

knime3.xlsx (11.0 KB)

im uploading th data, for it helps more. thanks!

1 Like

Hello @Alfonsoab
You can add a String Manipulation node to your ‘table2’ generating a $new column$

join(".+;", $ids$, "\|",".+;",$ids$,";.+","\|",$ids$,";.+","\|",$ids$)

Then the code for your Rule based Row filter…

$ticket$ MATCHES $ticket (#1)$ AND $ids$ MATCHES $new column$ => TRUE

As in this sketch…

BR

2 Likes

To add: as per the documentation you always need a wildcard pattern if you’re using the LIKE function but this is tricky when the function is based on another column.

image

Alternatively, you can you a contains() function in a Column Expression through contains(column("column1"),column("column2")) and thereafter only leave the true values.

2 Likes

Hi @ArjenEX
My first thought was -this isn’t the best node choice for the task-; then, the challenge is there.
I feed the wildcard pattern $new column$ to the node.

@ArjenEX solution is the most efficient one for this use case :ok_hand:

BR

im a bit late answering but the solution of @ArjenEX fitted perfect.

Thank you all :slight_smile:

3 Likes

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