Apama 10.7.2 | Using Apama with Software AG Designer | Using Query Designer | Creating queries in Query Designer | Adding query aggregates
 
Adding query aggregates
 
Adding query aggregate calculations
Adding query aggregate filters
An Apama query can specify aggregates that let the query find data based on many sets of events. You can add one or more of each of the following to your query definition:
*Aggregate calculation — Adding an aggregate calculation inserts a select clause in the source view of the query.
*Aggregate filter — This is a Boolean expression that refers to the events in the specified pattern of interest. This expression must evaluate to true for there to be a match. There can be zero, one, or more query filter conditions. Adding an aggregate filter inserts a having clause in the source view of the query.
You add query aggregates in the Aggregates pane of the Design view. Click the down arrow to the right of the plus sign , and select the kind of aggregate you want to add. Query Designer displays a dialog in which you define the aggregate. The following topics provide more information:
* Adding query aggregate calculations
* Adding query aggregate filters
After you add an aggregate in the Design view, it appears in a row in the Aggregates pane that shows the aggregate type, the expression that specifies the aggregate, and an alias for the aggregation. Select the aggregate to edit or delete it.
When you add an aggregate, it is immediately added to the source code. Any changes you make in the Source tab will be shown in the Design tab. If you introduce any errors into the query source code then you must resolve them in the Source tab before you can view the query in the Design tab.
For more details about the EPL code for query aggregates, see Aggregating event field values.