2 Replies Latest reply on Nov 8, 2013 1:41 AM by Gorazd Ozimek

    Inside calculation definition based on measure?

    Gorazd Ozimek

      This is a part of my calculation, which chooses a measure based on the combination of two filters, which is joined into [Measure + Time Period String]

       

      CASE [Measure + Time Period string]

      WHEN "Sales in LC Monthly" THEN

      WINDOW_SUM(SUM([Sales in LC]), 0, 0)

       

      WHEN "Sales in LC R3M" THEN

      WINDOW_SUM(SUM([Sales in LC]), -2, 0)

       

      WHEN "Sales in LC R6M" THEN

      WINDOW_SUM(SUM([Sales in LC]), -5, 0)

       

      WHEN "Sales in LC MAT" THEN

      WINDOW_SUM(SUM([Sales in LC]), -11, 0)

       

      WHEN "Sales in LC YTD" THEN

      RUNNING_SUM(SUM([Sales in LC]))

       

      So the calculation is based on choice of the measure - for example Sales in LC R6M is a moving total of last 6 months in local currency sales. Everything is working fine except the YTD figure. That figure should restart the running sum each year which can be defined in the table calculation window shown below (Restarting every Year of Time - Month). The problem is however that if I set this, it also affects other moving total measures which I don't want to. Is it possible to write a code specifically for YTD measure so that it restarts every year?

       

      Thanks,

      Gorazd

       

      Calculation window.JPG.jpg