4 Replies Latest reply on Aug 17, 2016 5:27 PM by Shinichiro Murakami

    Basic Calculation returning blank field, any ideas how to fix this?

    Adrian Sheather

      Hi There,

       

      I am building a dashboard where the viewer can select a time period (Day, Week, Month) and then see based on the period what the DoD, WoW or MoM % difference is for the dynamically chosen metric.

       

      I have build calculated metrics for all the relevant time periods, and now am trying create the % difference metric using:

       

      Example - ([Pageviews Last Month] / [Pageviews Previous Month])-1

       

       

      The end result is as follows:

      Metric
      Pageviews Last Month1,245,253
      Pageviews Previous Month1,367,858
      Pageviews MoM%

       

      The calculation I have used for the individual metrics such as Pageviews Last Month is as follows:

       

      IF DATETRUNC('month',[date]) = DATETRUNC('month',DATEADD('month',-1,TODAY()))

      THEN [pageviews]

      ELSE NULL

      END

       

      In my mind, if these Metrics return a value the calculation should work.

       

      Any ideas? I'm completely lost.

       

      Adrian