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
Welcome to the Amplitude Community!
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. You can also create a Guest account below!
If you're a current customer, select the domain you use to sign in with Amplitude.
analytics.amplitude.com analytics.eu.amplitude.comWelcome to the Amplitude Community!
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. Want to sign up as a guest? Create a Community account.
If you're a current customer, select the domain you use to sign in with Amplitude.
analytics.amplitude.com analytics.eu.amplitude.comEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.