Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

AVERAGE

Dan Gorman edited this page Nov 29, 2018 · 2 revisions

The AVERAGE Function

Function Group: Statistical

AVERAGE returns the minimum value in a numeric dataset.

Syntax

AVERAGE(arg1, [arg2...])

  • arg1 can be a number, string or an array of numbers or strings (or anything that can be coerced into being a number)
  • arg2 is optional, and has the same restrictions as arg1
  • AVERAGE also takes an arbitrary number of additional arguments

Uses

Let's say we're given a response with some driver performance information that looks like this:

{  
   "data":{  
      "driver_performance_ratings":{  
         "highest":98,
         "lowest":20,
         "fleet":[  
            30,
            60,
            55,
            99
         ]
      }
   }
}

If we want to find the mean average of the highest and lowest rated , we can just use AVERAGE:

AVERAGE(data.driver_performance_ratings.highest, data.driver_performance_ratings.lowest)

This would return 59.

Other Examples

AVERAGE can also take arrays as arguments.

AVERAGE(data.driver_performance_ratings.highest, data.driver_performance_ratings.lowest, data.driver_performance_ratings.fleet ) => 60.333

Clone this wiki locally