cancel
Showing results for 
Search instead for 
Did you mean: 

Rolling 30-Day Average

turtleData123
9 - Travel Pro
9 - Travel Pro

Hi all,

We're trying to create a rolling 30-day average in one of our bar chart widgets. I've tried using different solutions found online, but they all involve RPAVG, CURRENTDATE or other window functions that seem to break our connection to the live model or throw an unexpected token. An example we found was the following:

 

 

 

AVG( [ Total Value], RANGE ( PREV ( [Days in Date], 30 ), CURRENT([Days in Date])))

 

 

 

from which we got the 'not supported by Live Model' error. 

I've also tried repeatedly adding together ( [Total Value] , PREV( [Days in Date] , n)) from n=1 to 30, but this seems to overwhelm the widget and break connection with the model (though it works in theory, I did get it to work with smaller n, such as 5)

Any help would be greatly appreciated.

5 REPLIES 5

DRay
Community Team Leader
Community Team Leader

Hi @turtleData123,

Thank you for reaching out. RPAVG should work with Live Models as of 2023.11. What version are you on?

David Raynor (DRay)

We're on version 2024.3. I'm testing the RPAVG with an elasticube currently, and it's giving incorrect values (checked using excel). I've uploaded an image of the widget's configuration page, each formula is visible as the title of the respecting value, for reference. Additionally, we need the average to run through the first days as well, which this doesn't seem to do - it begins with the [ first day value ] / 1, and iterates

turtleData123
9 - Travel Pro
9 - Travel Pro

Additionally - I can confirm the following works with the elasticube:

RPSUM([Total GROUPEXTNETREVENUEAMT], 30) / 30

however when I take it to a live model, it breaks the connection with our model, throwing an unknown error

 

DRay
Community Team Leader
Community Team Leader

I would reach out to support. They can look into why it's not working with the Live Model.

David Raynor (DRay)

OK, thanks for the reply