Rank but restarting after breaks

Hello Knime users i come with a bit of a specific problem i have a giant document with multiple people in it, these people are not allowed to work more than 7 consecutive Sundays SO i need some way to count how many consecutive cells have the same word in it here is an example

and here how i would like to be


Ofcorce it does not need to be EXACTLY like this but i do need some help in any way i would be able to at least know a person has 7 consecutive work days

thank you for your help

Hi @Bleck , this thread from 2022 shows one way of achieving this using a group loop and the Moving Aggregation node

If you have access to the KNIME hub, though, I have a component called “Cumulative Count for Grouping” that can simplify this for you, and uses an alternative method based on Java Snippet.

If you add this component to your workflow, and configure it so that the grouping column is your “work” column, it should give you the result you want. NB you may find you have to execute the component once after attaching it to the previous node before configuring it, so that it can detect the available columns. This is just a quirk of some components.

4 Likes

Yeah this works perfectly thank you very much

1 Like

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