MAX
returns the largest value in a numeric dataset. It also takes an arbitrary number of additional arguments.
Function category: Statistical​
MAX(arg1, [arg2...])
Arguments | Description |
| Number, string or an array of numbers or strings (or anything that can be coerced into being a number) |
| Optional. Same requirements as |
Let's say we're given a response with some service station information that looks like this:
{"data": {"local_service_ratings": {"cheapest": 4,"nearest": 6,"regional": [4,5,6,8,9]}}}
If we want to find highest rated service stations, use the following function.
# Find highest ratedMAX(data.local_service_ratings.cheapest,data.local_service_ratings.nearest)​# Returns 6
MAX
can also take arrays as arguments, as shown in the following function.
# Find the largest regional service stationMAX(data.local_service_ratings.cheapest,data.local_service_ratings.nearest,data.local_service_ratings.regional)​# Returns 9