Apama 10.15.0 | Developing Apama Applications | EPL Reference | Aggregate Functions | Built-in aggregate functions
 
Built-in aggregate functions
EPL provides built-in aggregate functions in the com.apama.aggregates package. All of these functions are available for either bounded or unbounded use. See the com.apama.aggregates package in the API Reference for EPL (ApamaDoc) for detailed information on each built-in aggregate function.
To use a built-in aggregate function in a stream query, you must do one of the following:
*Specify the full name of the aggregate function. For example:
select com.apama.aggregates.sum(x)
*For each aggregate function you want to use in your code, add a using statement. This lets you specify aggregate function names without specifying the package name. For example:
using com.apama.aggregates.mean;
using com.apama.aggregates.stddev;
...
...select MeanSD( mean(s), stddev(s) );
Insert the using statement after the optional package declaration and before any other declarations in the .mon file.
See also:
* Working with Streams and Stream Queries
* Aggregating items in projections