Trouble calculating starting and ending headcount using a Loop

I have 8 months of data, starting from may 2023 until december 2023. I need to calculate the starting and ending headcount for each month. ending headcount is calculated as:

starting hc + new clients - dropped clients

starting headcount should be the ending headcount of the prior month.

I’m pretty sure i need to use a loop node (recursive?) and tried several different options to get it to work but I’m a bit lost.

Any help will be greatly appreciated!!

Hi, @sheidari81

Welcome to the KNIME Community Forum.

Please help us to help you.
If you give an example with data, we will be able to help you better.
How is your input data. How do you need you output data.

Best regards


thanks for the welcome and tip, @hmfa!

This is the current state of the data:
Screen Shot 2024-01-26 at 9.11.45 PM

The is the expected output:

Screen Shot 2024-01-26 at 9.13.04 PM

You’re more likely to get help if you upload actual data rather than posting screenshots. Knimers won’t have to waste time retyping your data.

here you go!

Sample Data.csv (604 Bytes)

Hi @sheidari81 .

Have a look at this solution
Maybe it can help you.

Trouble calculating starting and ending headcount.knwf (92.9 KB)

Best regards


Nicely done! Very clever.

KNIME is a great tool, like a Swiss Army knife…:wink:

1 Like

@hmfa amazing! it works like a charm and very clever way of solving it!

I’m an Alteryx power user so still getting used to KNIME and really liking it. Thanks for your help and tips!


I’m hapy to have been able to assist!

1 Like

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