Looking for a string in different cells

Hi @all,

I solved my request for half - but for the another important 50% I have to ask you as a Newbie.
My table contains familiar values in different cells, there is no order in column or row.
input:
Paula | blue | bike | jeans |
Peter | zero | car | shirt |
Prince | green | tram | bike |

I want a new column with all listed “bikes” to a person. For one column it is easy and solved with row filter, but I have more than 500 unsorted columns.
result:
Paula | blue | bike | jeans | 1 |
Peter | zero | car | shirt | 0 |
Prince | green | tram | bike | 1 |

Thanks a lot!
Rico

Hi @RicoGaertner

Please find below a possible solution based on aggregation of columns and the LIKE condition is -Rule Engine- node.

$Concatenate$ LIKE "*bike*" => 1
TRUE => 0

Only the -Column Aggregator- and the -Rule Engine- nodes are needed here. The -Cell Splitter- node is just here to pre-process your posted data.

Hope this helps.

Best

Ael

7 Likes

Hello @RicoGaertner,

and welcome to KNIME Community!

Do you want to count number of “bike” occurrences or simply have 0 or 1 to indicate existence of it in a row?

Br,
Ivan

4 Likes

Hi ipazin,

thank your for your question. In my request it is simple ok to get 0 or 1 as a result. More charm has the string “bike”.

Best regards
Rico

1 Like

Hi @aworker ,

great - thank you! It works!
I also experimented and tinkered further and came up with a similar solution. But your answer was quicker.
String Manipulation (Multi Column) with count($$CURRENTCOLUMN$$,“bike”)Column Aggregator with Setting - Options “Sum”Row Filter

Best regards
Rico

3 Likes

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