1 Reply Latest reply on Nov 2, 2018 6:16 PM by swaroop.gantela

    Average Cost

    David Gabra

      Hi

       

      Please can you help me for this.

      1. If I want the average cost of a taxi and it must be  trip number,

      then would the calculated field be

       

      [fixed trip number, sum (expense type="taxi"  : avg(expense cost)  }

       

      2. if I want to know where the number of taxi expense type  is smaller of equal to < 2  what would be the formula - it must be per  trip number

      - field name is trip number and expense type (where we need to say equals - taxi).

       

      3. if I want to know where the costs of taxi expense type  is greater  or equal to 100   What would be the formula - it must be per  trip number

      - field name is trip number and expense type (where we need to say equals - taxi) and cost field 'cost'

       

      thank you

       

      David.

        • 1. Re: Average Cost
          swaroop.gantela

          David,

           

          I'm not sure how you will be using these three metrics,

          so these may need to be further adjusted.

           

          For the Average, you can try:

          AVG( { FIXED [Trip Number] : SUM ( IF [Expense Type] = "Taxi" THEN [Cost] END ) } )

           

          For <2:

          IF [Cost]< 2 THEN 1 ELSE 0 END

           

          If these are going on a summary dashboard, you can drag them all to measure shelf

          with the <2 and >100 being summed.

           

          Please see workbook v10.3 attached in the Forum Thread:

          Average Cost

           

          286624avg.png

          1 of 1 people found this helpful