AVG_EACH
Stores the average value for each group
Syntax
AVG_EACH([MAX_VALUE, ]GROUP, VALUE)
Arguments
MAX VALUES:
The maximum number of groups. Groups beyond this amount will be discarded.
VALUES:
In some cases, depending on the data distribution, discarding groups via MAX
may cause some data to be discarded from groups that would otherwise have
been returned. MAX VALUES
is optional. If it's omitted, there is no limit.
GROUP:
The field being evaluated.
VALUE:
The numeric field that is averaged.
Returns
The result type is a "number" which can be either integer or floating point.
Notes
Nulls within the group are ignored. If a group is empty or consists only of nulls, the result is NULL. e.g. time period 1628894760000, in the example below, contains a null. A null group key will also be ignored.
Example
Data
Query:
Find the average cpuUsage in each serverip:
Results:
Related Functions
Dialog
Last updated