1 Reply Latest reply on Oct 19, 2018 8:40 AM by Joe Oppelt

    Help with error

    Lorie May

      I've been struggling with this for some time, so I'm hoping someone can help me. I'm using the calculation below for the current period and have another for comparison period. if I can get one to work so will the other.

       

      Select a metric refers to countd(Car no) and avg(audit score). I am able to change the formula below by adding Countd(IF but the metrics are two different aggregations. I don't want users to loose the option to select. What can I do?

       

      IF

        (DATETRUNC([Compare by], [Audit End]) =

        DATETRUNC([Compare by], [Start date])

        AND

        DATETRUNC('day', [Audit End]) <=

        DATETRUNC('day', [Start date]))

      THEN

        [Select a metric]

      END

        • 1. Re: Help with error
          Joe Oppelt

          Give the user a parameter with two values.

           

          Make a calc [select a metric] that looks like this:

           

           

          IF [Select parameter] = "COUNTD" then COUNTD([Car no])  ELSE  avg([audit score])  END

           

          Or, if you already have separate calcs for those two things, then just insert those calcs directly in that logic in place of the aggregates I spelled out.