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 restrictions as arg1.

Examples

Example 1: Find the average of the highest and lowest rated performance

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
]
}
}
}

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

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

This would return the following:

59

Example 2: Arrays

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