Solved

Is ROLLWINBEFORE working?

  • 10 October 2022
  • 2 replies
  • 168 views

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!

icon

Best answer by timothy-permutable 11 October 2022, 09:27

View original

2 replies

Badge +10

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