90 day running aver...
 
Notifications
Clear all

90 day running average

2 Posts
2 Users
0 Reactions
360 Views
New Member
Joined: 11 months ago
Posts: 1
Topic starter  

Hi, How do you calculate a 90 day running average starting from the previous day (and recalculated for every day of a day dimension)?


   
Quote
Jedox 4 Beginners
Trusted Member Admin
Joined: 3 years ago
Posts: 35
 

hi Pierre,

I would do it this way but feel free to modify my idea:

  1. I will create a parallel hierarchy for dates which will have suffix _AVG90 (Example: 2024-08-26_AVG90)
  2. Go to Integrator and add two variables type groovy (today ${Today}: return new Date().format("yyyy-MM-dd") and 90 days prior ${Today-90} return (new Date()-90).format("yyyy-MM-dd"))
  3. Create an extract from the desired cube and make filtering on dates accept.inAlphaRange [${Today - 90},${Today}]
  4. Make sure you include empty cells so avg can be more accurate. These empty cells will be presented as null which you can replace by zeros in Groovy Function by just writing "return _input1" and check Null Default.
  5. Create a Table aggregation where input will be your day as a constant value ${Today}-AVG90 (meaning you would like to write a value to this cell)
  6. In Measure choose #Value and make sure aggregation is AVG.
  7. Write this back to the cell and schedule the job to run every day after midnight.

 

Tadaaaa


   
ReplyQuote
Share:

Join the Jedox4Beginners forum and engage with a community of passionate Jedox users. Get expert advice, share insights, and find solutions to your Jedox-related queries. Unlock the power of collaboration and accelerate your learning journey in the world of Jedox.

Join the Jedox4Beginners forum!