Was this helpful?
Using Aggregation Functions
Using the Group Operator to Compute Aggregations and Using the RowsToColumns Operator to Convert Rows to Columns (Pivot) make use of a special class of functions called aggregations. Aggregations can only be used in certain cases depending on the operator. The static methods of the Aggregation class can be used to construct the aggregate functions listed below.
Note that the output type is dependent on the type of the input fields. Therefore only the widest possible output type is listed below. Also for most of the aggregations a function can be used instead of a field name if the aggregation should be performed on a derivation of the original data.
Function Name
Description
Output Type
Parameters
Aggregation.as
This function can be used with any of the other aggregation functions to specify the output field of the function.
Same as original aggregation
String value
Aggregation.avg
Calculate the average value aggregation for the input.
Numeric
String value
Aggregation.corr
Calculate the correlation aggregation for the two specified inputs.
Numeric
String value
String value
Aggregation.count
Calculate the count of all rows in the input.
Long
String value
Aggregation.covar
Calculate the covariance aggregation for the input. May optionally specify that the input is a sample by setting the boolean argument sample to true.
Numeric
String value
String value
Optional boolean
Aggregation.distinct
This function can be used with any of the other aggregation functions to set the distinct flag.
Same as original aggregation
Boolean value
Aggregation.geoAvg
Calculate the geometric average aggregation for the input.
Numeric
String value
Aggregation.harmAvg
Calculate the harmonic average aggregation for the input.
Numeric
String value
Aggregation.kurtosis
Calculate the kurtosis aggregation for the input. May optionally specify that the input is a sample by setting the boolean argument sample to true.
Numeric
String value
Optional boolean
Aggregation.max
Calculate the maximum value of all rows in the input.
Same as original input
String value
Aggregation.min
Calculate the minimum value of all rows in the input.
Same as original input
String value
Aggregation.moment
Calculate the central moment of all rows in the input. Must specify the moment k to calculate.
Numeric
String value
int value
Aggregation.skewness
Calculate the skewness aggregation for the input. May optionally specify that the input is a sample by setting the boolean argument sample to true.
Numeric
String value
Optional boolean
Aggregation.stddev
Calculate the standard deviation aggregation for the input. May optionally specify that the input is a sample by setting the boolean argument sample to true.
Numeric
String value
Optional boolean
Aggregation.sum
Calculate the value summation aggregation for the input.
Numeric
String value
Aggregation.sumSquares
Calculate the sum-squares aggregation for the input.
Numeric
String value
Aggregation.var
Calculate the variance aggregation for the input. May optionally specify that the input is a sample by setting the boolean argument sample to true.
Numeric
String value
Optional boolean
Last modified date: 06/14/2024