AVERAGE

AVERAGE returns the minimum value in a numeric dataset.

Function category: Statistical

Syntax

AVERAGE(arg1, [arg2...])

AVERAGE can take an arbitrary number of additional arguments.

Arguments

Description

arg1

Can be a number, string or an array of numbers or strings (or anything that can be coerced into being a number).

arg2

Optional. Same requirements as arg1.

Examples

Let's say we're given the following response with some driver performance information.

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

Example 1: Find average of highest and lowest rated performance

If we want to find the mean average of the highest and lowest rated driver performance, we use the following function.

# Find mean average of highest/lowest rated driver performance
AVERAGE(data.driver_performance_ratings.highest,
data.driver_performance_ratings.lowest)
# Returns 59

Example 2: Arrays

AVERAGE can also take arrays as arguments.

# Array taken as argument
AVERAGE(data.driver_performance_ratings.highest,
data.driver_performance_ratings.lowest,
data.driver_performance_ratings.fleet)
# Returns 60.333