Trouble calculating starting and ending headcount using a Loop

Hi @hmfa, you recently helped me with fixing an issue around calculating starting and ending headcount using the loop node. Thank you for that!

It seems like i’ve run into a problem though when I add January data. It’s not able to calculate the ending headcount value correctly and i believe it has something to do with the fact that the year has changed from 2023 to 2024. So the group start loop node is unable to include 2023 and 2024 in the loop, so it can’t cumulatively calculate the “value_add” amount.

Here’s an updated csv file with the current and desired output. Would you mind looking at the solution you built and helping me figure out a fix for it?

Sample Data.csv

(659 Bytes)