Forum Discussion

turtleData123's avatar
turtleData123
Cloud Apps
10-29-2024
Solved

Rolling 30-Day Average

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.

  • Hey DRay, following up in case this issue comes up in the future - I got back from support the following:

    We're sorry for any inconvenience, but the following function is no longer officially documented or supported. It was deprecated some time ago, but it hasn't been removed from the product yet. Thank you for your understanding.

    I did make a forum post to suggest adding a new version of these RP functions over at Product Feedback. Thanks again for the help

6 Replies

  • Hi turtleData123,

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

    • turtleData123's avatar
      turtleData123
      Cloud Apps

      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

  • 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

     

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

    • turtleData123's avatar
      turtleData123
      Cloud Apps

      Hey DRay, following up in case this issue comes up in the future - I got back from support the following:

      We're sorry for any inconvenience, but the following function is no longer officially documented or supported. It was deprecated some time ago, but it hasn't been removed from the product yet. Thank you for your understanding.

      I did make a forum post to suggest adding a new version of these RP functions over at Product Feedback. Thanks again for the help