# Expression ? Row Filter ?

**URL:** <https://forum.knime.com/t/expression-row-filter/86265>\
**Category:** KNIME Analytics Platform\
**Created:** [February 10, 2025, 4:09pm UTC](https://forum.knime.com/t/expression-row-filter/86265 "2025-02-10T16:09:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brain](https://forum-cdn.knime.com/user_avatar/forum.knime.com/brain/32/53424_2.png) [@Brain](https://forum.knime.com/u/Brain)\
**Post date:** [February 10, 2025, 4:09pm UTC](https://forum.knime.com/t/expression-row-filter/86265/1 "2025-02-10T16:09:04Z")

</div>

HI  
I dont find the right prompt to filter correctly what i want. This is an example of a small dataset.  
I want to keep only the races (RNO) which have at least 14 starters (= POS 1 to 14).  
In this example RN0 98 is the only one that must be retained.  
[14 RUNNERS.xlsx](https://forum.knime.com/uploads/short-url/yHgGwrB3kkbc89hUeq0dbUPfXs6.xlsx) (10.3 KB)  
Thanks for your help  
Br

---

<div class="post-metadata">

**Author:** ![gonhaddock](https://forum-cdn.knime.com/user_avatar/forum.knime.com/gonhaddock/32/35425_2.png) [@gonhaddock](https://forum.knime.com/u/gonhaddock)\
**Post date:** [February 10, 2025, 4:55pm UTC](https://forum.knime.com/t/expression-row-filter/86265/2 "2025-02-10T16:55:55Z")

</div>

Hello @Brain  
I see two possible outcomes for this challenge:

1. The simple low code would be a Group Loop running on RNO field. and filtering max. POS \>14 as output (the filtering can be done after loop end for simplification, by plotting max. POS constant value column for the group loop value).

2. The ‘smart’ solution can be a ‘Expression’ node coded; dynamically ranged logical indexing for the max. POS \> 14, avoiding loops.

For the second solution, I feel challenged to test it; as I’ve built [similar solutions](https://forum.knime.com/t/using-data-from-previous-row-in-calculation-with-loop/77591) with the outdated ‘Column Expressions (legacy)’ node. And I had no time to experience with the more powerful updated node version.

I hope this suggestions can help you.

BR

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [February 10, 2025, 5:03pm UTC](https://forum.knime.com/t/expression-row-filter/86265/3 "2025-02-10T17:03:08Z")

</div>

Hi @Brain, another possibility is the following structure, if you are just wanting where there are at least 14 starters, but it doesn’t specifically require that POS=1 to 14. (e.g. If your dataset was POS=3 to 16, it would still match)

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/0/e/0e1cb48e7642cbd07790fb86b4c2ffb6b7948aaf.png)

The GroupBy should be configured to GroupBy RNO and get a count of POS, which with your sample data would return this:

![image](https://forum-cdn.knime.com/uploads/default/original/3X/b/e/be918412841f21ca9dc66e0ca175a97d5e2e149d.png)

The Row Filter is configured to return only those rows where Count\*(POS) \>=14, which returns this:

![image](https://forum-cdn.knime.com/uploads/default/original/3X/a/5/a52ae17834bf54ab2e7bafc539a8cf4d517cbc96.png)

And finally joining the original data set to the output of the Row Filter, joining on RNO = RNO returns all the rows for the filtered RNO:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/d/e/de63f3a60ca08a9b890b41ec8ae9f9243b0a9c9d.png)

edit: If you do require that POS=1 to 14+, and at least 14 starters, then you could modify the groupby to return Min(POS), Max(POS) and Count(POS), and then in the Row filter you’d also include that MIN\*(POS) =1 and maybe Max(POS) \>= 14 and so on, depending on your exact need.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [May 11, 2025, 5:03pm UTC](https://forum.knime.com/t/expression-row-filter/86265/4 "2025-05-11T17:03:23Z")

</div>

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