1 Reply Latest reply on May 18, 2018 7:12 AM by Jennifer VonHagel

    Calculation with data sum window(avg)

    Tina Crouse

      I have a rolling 13 months' in my window view. Right now it starts with Feb 17 and end with Feb 18. I have this as my calculation:

       

      IF ATTR([Yr Mth YEAR]) = 2017 AND

      ATTR([Month]) >= 2 THEN 

      WINDOW_AVG(SUM([Days/K]))

      ELSEIF ATTR([Yr Mth YEAR]) = 2018 THEN

      WINDOW_AVG(SUM([Days/K]) - 10) END

       

      My issue is I don't want to have to go in and update this every month. When the data refresh is done and the time period in the window changes to Mar 17 and ends Mar 18, I want it to automatically update.

       

      I also cannot figure out how to deduct 10% of the sum when I switch to year 18. I tried * .90 but that did not work.

        • 1. Re: Calculation with data sum window(avg)
          Jennifer VonHagel

          Hi Tina, for your first question, are you trying to find the average across months of the same year?  Can you just use a plain WINDOW_AVG(SUM([Days/K])) and then set it to Compute using the Year? So something like this...

          and then set it to Compute by Year? If you put Year in the view as shown below, you can choose Compute Using > Pane Across on the window_avg.

           

          If you don't want to show the Year in the chart, you can drag it down to the Detail card in the Window_Avg marks card:

           

          For your second question, I'm not sure what you mean by subtracting 10% at 2018.

           

          best,

          Jennifer

          1 of 1 people found this helpful