runningSum Partition Inconsistent

My runningSum seems to be producing inconsistent values whenever the partition field has more than 2 unique values.

For example, see top graph Jan-2023 value = 296 (correct value) without partition, but when I partition (bottom graph) by status (3 unique statuses) I get Jan-2023 value = 289 (wrong value).

Calculated fields:

  1. cumulativeValueNoPartition = runningSum(distinct_count(id), [truncDate(“MM”, {employeeCreatedAt}) ASC])

  2. cumulativeValueStatusPartition = runningSum(distinct_count(id), [truncDate(“MM”, {employeeCreatedAt}) ASC], [{employeeStatus}])

As I can see in the bottom graph is that your light blue status has a running sum value of 7 but ends in October. 7 + 289 = 296 (correct value).

What this is doing is that it will take the running sum of those status and add them together (when they are present in that month).

Let me know if this solution helps.

Hi @Max, thanks for your response and thanks for the link to the adjacent conversation.

I read through the thread. The solution solves a slightly different problem. Yes, there are comments post-solution that are more relevant, but I’m having trouble following with the minimal context that is given.

Would you be so kind as to explain how I could produce an accurate cumulative plot in my case (given that certain statuses might not appear in every month)?

You can look at this solution as well.

The only way to get it to show up in a month would be to have that status for that month be available.

If you are doing a sum then that status for that month would be zero, but it needs to be a value in that group in the dataset.

Hope that makes sense.