Rolling 3 month Average in a dataview

Can I create a moving average in a dataview? For example I would like 12 months of data as Bars on a chart and then have a 3 month moving average as a line on the chart so lets say that periods 9,10,11,12 had the values 38, 40, 45, 49 on my chart the bar for period 12 would be at 49 and the 3 month ave for period 12 would be 44.6, and for period 11 the bar would be at 45 and the line would be at 41.  Thanks!

Tagged:

Answers

  • Hi Adam,

     

    check out the Yearly Moving Average in combination with Cycle: Time functions. This should give you the functionality you are looking for.

     

    BR

     

    Sebatian

  • Adam Elvin
    Adam Elvin Employee
    10 Comments 25 Up Votes Second Anniversary 5 Likes
    edited March 2020

    Thanks Sebastian,  used the time function to create two additional blocks (which i flagged as hidden) and used the time functions to offset to Previous period and also previous period -1, the algorithm is the (a+b+c)/3

     

    imageimage

  • Thanks Bjorn, great tip!