This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
AVERAGE
Dan Gorman edited this page Nov 29, 2018
·
2 revisions
AVERAGE
returns the minimum value in a numeric dataset.
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 asarg1
-
AVERAGE
also takes an arbitrary number of additional arguments
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
.
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