Skip to main content

Hi, I’m using the ROLLWINBEFORE formula and noticing it produces the same result as ROLLWIN. For a monthly metric, I’m expecting ROLLWIN(UNIQUES, A, 1) gives result for the current month while ROLLWINBEFORE(UNIQUES, A, 1) gives result for last month. Am I interpreting this wrongly? Thanks in advance!

Hi Bruce!

Yes you’ve misunderstood ROLLWINBEFORE. ROLLWINBEFORE compares the same window of time as ROLLWIN, but the difference is in the sequence the aggregation is applied (e.g. average and then sum vs sum and then average). Therefore in your example, since the aggregation is over a single month, the result is the same because the sequence doesn’t make a difference (count unique then aggregate vs aggregate then count unique)

 

If you are looking for a formula which gives the previous month, I don’t think there is one, so I often use this little maths trick: 2*ROLLAVG(UNIQUES, A, 2)-UNIQUES(A)


Thank you!


Reply