3 Replies Latest reply on Dec 6, 2018 6:56 PM by Zhouyi Zhang

    Adding a Percent Difference for a Running Metric

    Ian McKnight

      I'm having trouble adding a Percent Difference table calculation to a metric that is already based on a Running Total table calculation; i.e. i'm trying to use two different table calculations concurrently but am unable to get it to work right.

       

      The running metric in question is written as:

       

      RUNNING_SUM([Numerator])/RUNNING_SUM([Denominator])

       

      Additionally, it is set to compute along Table(down), to aggregate running totals by date:

       

      What I want to do is simply show the Percent Difference of this running metric for each day, but i'm unable to select a second table calculation after already using the RUNNING_SUM table calculation. Trying to manually write it as either of the formulas below gives me incorrect values that do not reflect the actual differences between the 'Group A' and 'Group B' columns shown above.

       

      • ([Running Metric Name]/LOOKUP([Running Metric Name],-1))-1
      • (ZN([Running Metric Name]) - LOOKUP(ZN([Running Metric Name]), -1)) / ABS(LOOKUP(ZN([Running Metric Name]), -1))

       

      Both of the above formulas yield the following, which is not correct:

      Checking the numbers in excel shows how far off these are, as they should match the rightmost column below:

       

      Is there any other way I could approach this or write these formulas to summarize the data the way I need to?

       

      Thank you!