java.lang.Object
com.pervasive.datarush.functions.Statistics
Provides implementations of common statistical functions. These functions are
for calculating aggregations within the fields of a record. To
calculate aggregations over an entire data set, use
Group instead.- See Also:
-
ScalarValuedFunctionDeriveFields
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScalarValuedFunctionBuilds an expression computing the average of the values of the specified fields.static ScalarValuedFunctionavg(List<ScalarValuedFunction> exprs) Builds an expression computing the average of the specified expressions.static ScalarValuedFunctionBuilds an expression computing the weighted average of the values of the specified fields.static ScalarValuedFunctionwavg(List<ScalarValuedFunction> exprs, double[] weights) Builds an expression computing the weighted average of the values of the specified expressions.
-
Constructor Details
-
Statistics
public Statistics()
-
-
Method Details
-
avg
Builds an expression computing the average of the values of the specified fields.- Parameters:
fields- the fields to include in the average- Returns:
- a function evaluating the expression
-
avg
Builds an expression computing the average of the specified expressions.- Parameters:
exprs- the expressions to include in the average- Returns:
- a function evaluating the expression
-
wavg
Builds an expression computing the weighted average of the values of the specified fields.- Parameters:
fields- the fields to include in the averageweights- the weights to apply to each field- Returns:
- a function evaluating the expression
- Throws:
com.pervasive.datarush.graphs.physical.InvalidPropertyValueException- if the number of weights does not match the number of fields
-
wavg
Builds an expression computing the weighted average of the values of the specified expressions.- Parameters:
exprs- the expressions to include in the averageweights- the weights to apply to each expression- Returns:
- a function evaluating the expression
- Throws:
com.pervasive.datarush.graphs.physical.InvalidPropertyValueException- if the number of weights does not match the number of expressions or if no expressions are supplied
-