Rule based Filter

Hello,

I am trying to filter rows based on including the higher of two criteria. I have the below in the same column that I am trying to filter. I need the filter to be based on the last two numbers and I need it to be dynamic because I will run other files through the workflow that will have different digits at the end. For example the next group of data would have strings that would end in 61 and 60.

CU000001X060A00NPEP59 - I want to exclude based the 59 is less than 60

CU000001X060A00NPEP60 - I want to include based on the 60 is greater than 59

Any help is greatly appreciated.

Kevin

Hi @KevinD1

First use the String Manipulation node to extract the last to digits/characters from the input string using

substr($column1$,length($column1$)-2 ,2 )

The output is input for the Row Based Rule Filter/Splitter to filter/split your file.
gr. Hans

1 Like

Hans,

Thank you for the reply. The string manipulation node work to extract the number but I am not familiar how to use the Rule Based Filter to filter out the the lower number in the new column created. I can’t just say filter out 59 because I will run the workflow with different files that will contain different numbers and would have to reconfigure the node for each set of files I run. Is there way to filter on the Max or the Min of the new column is my question? That would eliminate re-configuring the filter node when files change.

Thanks,

Kevin

1 Like

Hi @KevinD1

See this workflow (with 2 options) rule_bases_row_filter.knwf (23.3 KB)
gr. Hans

2 Likes

Hans,

Thank you very much for your help. I used the shorter option since I have a pretty big workflow but works as I needed. Since I am new to Knime your assistance helped me with the formula writing for the nodes to work.

Thank you again for the help.

Kevin

2 Likes

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