How to accumulate a sum from a specific period backwards

Hi guys,

I need to calculate the accumulated number of customers over the last 90 days as a window in time.
I tried using “runningSum” and “periodToDateSum” but it didn’t work.

periodToDateSum({qty_customers}, {my_date} , ‘MONTH’, 3)

runningSum(
sum({qty_customers}), [{my_date } ASC])

The “runningSum” accumulates all dates, but I need a date to accumulate the number of customers up to 90 days ago, do this for all days.

Example:
Date | Qty | runningSum_90days
20250201 | 100 | xxx → this needs to accumulate the number of customers 90 days backwards from this date

20250202 | 200 | xxx → this needs to accumulate the number of customers 90 days backwards from this date

I tested it with “windowSum”, but it has been increasing since the beginning of the year and the correct is to sum 90 days ago

windowSum(sum({qty_customers}), [my_date ASC], 90, 0)

Hello @July !

To make sure I understand what you want, according to your screenshot, you would expect to see 3,409 rather than 23,633?

Have you tried the solution outlined here:

Exacty! I want to see 3.409

Hey @July ,

Were you able to try the solution from the topic I linked above?

1 Like

Hi @duncan

No, unfortunately, I resolve this directly my dataset

Tks!

1 Like