"For" loop to verify content of cells


I’m currently facing quite some issues with one of my workflows. The problem is the following: I have two different tables, a main table and a reference table. Each table has one of its column containing a “List (Collection of:String)”. The content of each of those columns (collection of:String) are numbers with the main table having from 1 to 30 strings (on one column) and the reference table from 1 to 3 strings(on one column). There is about 220’000 rows.

The question is the following: I want to be able to flag all the rows in my main table which contains one of the sequences of strings of my reference table.

For example: row 2 of my main table contains [8, 23, 69, 27, 3] and the reference table on row 21 contains [3, 69]. In this case the main table has a match with the reference table so the row of the main table should be flagged. Other possibilities here would be: [8] ; [27, 69] ; [3, 23, 27] etc…

I usually code in R and wouldn’t have any problems with this, but this is quite challenging for me on KNIME as I am a new user. I tried to use reference row filters but in that case the whole cell has to match which isn’t my case here. Further I tried to use loops (which I think is the best alternative here), but I do not manage to make one that works…

A tip from a pro around here would be greatly appreciated. Thanks and have a good evening!

Take a look if this example can help you, specifically Subset Matcher node


If you can code it in R, then using an R Snippet node could be worth looking into.

Thank you for your help!

1 Like

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