Aggregation Functions
Aggregation functions
This section explains how to use and combine different aggregation functions in APL.
The table summarizes the aggregation functions available in APL. Use all these aggregation functions in the context of the summarize operator.
Function | Description |
---|---|
avg | Returns an average value across the group. |
avgif | Calculates the average value of an expression in records for which the predicate evaluates to true. |
count | Returns a count of the group without/with a predicate. |
countif | Returns a count of rows for which the predicate evaluates to true. |
dcount | Returns an estimate for the number of distinct values that are taken by a scalar an expressionession in the summary group. |
dcountif | Returns an estimate of the number of distinct values of an expression of rows for which the predicate evaluates to true. |
histogram | Returns a timeseries heatmap chart across the group. |
make_list | Creates a dynamic JSON object (array) of all the values of an expression in the group. |
make_list_if | Creates a dynamic JSON object (array) of an expression values in the group for which the predicate evaluates to true. |
make_set | Creates a dynamic JSON array of the set of distinct values that an expression takes in the group. |
make_set_if | Creates a dynamic JSON object (array) of the set of distinct values that an expression takes in records for which the predicate evaluates to true. |
max | Returns the maximum value across the group. |
maxif | Calculates the maximum value of an expression in records for which the predicate evaluates to true. |
min | Returns the minimum value across the group. |
minif | Returns the minimum of an expression in records for which the predicate evaluates to true. |
percentile | Calculates the requested percentiles of the group and produces a timeseries chart. |
rate | Calculates the rate of values in a group per second. |
stdev | Calculates the standard deviation of an expression across the group. |
stdevif | Calculates the standard deviation of an expression in records for which the predicate evaluates to true. |
sum | Calculates the sum of an expression across the group. |
sumif | Calculates the sum of an expression in records for which the predicate evaluates to true. |
topk | calculates the top values of an expression across the group in a dataset. |
variance | Calculates the variance of an expression across the group. |
varianceif | Calculates the variance of an expression in records for which the predicate evaluates to true. |