Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rolling Vs Previous

Hi ,

I have posted a query w.r.t this topic already, but still unable to differentiate between these 2:

Ex Scenario:

I have data for 2015,2016,2017 (Jan till Dec for all years).  i need to compare in a bar chart the Rolling12 months sales to Previous12months sales.

For rolling12 months i used the below in expression:

=Sum({<Date={"$(='>=' & Date(MonthStart(Max(Date), -13)) & '<' & Date(MonthStart(Max(Date))))"}>} Sales)

or

PeriodID = {">=$(=Max(PeriodID)-11)<=$(=Max(PeriodID))"}

This is resulting in Rolling 12 months. Like 2017 Jan Till Dec sales.

If i want to calculate the previous12 months will it be like : present month April 2018 back 12 months which is May 2017 Till April 2018, is my assumption correct or not?

Can any one please suggest a code to calculate previous12months, i worked out with almost all links provided in community, i can see Rolling12months but not Previous12months. 

Can i get a response on my scenario please?

4 Replies
vishweshwarisun
Partner - Creator
Partner - Creator

try this:

Sum({< Month=, Date={">=$(=MonthStart(today(), -11))<=$(=(today()))"}>}Sales)

sunny_talwar

I would suggest you to look into The As-Of Table and I think mrkachhiaimp‌ have already showed a demonstration of the same here Previous12 and Rolling12

Anonymous
Not applicable
Author

Thanks Sunny, nice reference.

Anonymous
Not applicable
Author

Hi Vishveswari,

I tried that, but in my case i should not be using Today(), as i have no data for 2018, i worked out by creating Flags in the backend script and seems to be working alright, thank you very much for the reply.

Regards