Designing Intelligent Event Processor (IEP) Projects

Time Based Aggregator

The Time Based Aggregator operator performs statistical analysis within a specified amount of time that you provide as a size, which is period of time over which you can perform a calculation, or the time slot. Increment specifies the frequency of the calculation; that is, how often you calculate the statistical analysis.

Assume that you want to calculate a stock price's 20–day moving average. You can supply a size of 20 in the property editor, and an increment that specifies how often you want to perform that calculation (for example, once a day).

Statistics that you can compute via SQL statements in the property editor of the Time Based Aggregator operator include:

Use the Time Based Aggregator operator when you want to perform real-time statistical analysis. You can do simple or complex SQL manipulation within the time frame that you specify, by using the Select, From and Where clauses, as indicated in the property editor.

For example, given a stream of transactions of a stock, you can compute the new stream that holds the hourly minimum average and the maximum of the stock price.

ProcedureTo Create a Time Based Aggregator Operator

  1. Drag a Time Based Aggregator operator from the Palette to the Design view.

  2. Double-click the Time Based Aggregator operator.

    The property editor opens.

  3. In the Start field, enter the time to start calculating the tasks that are to be performed by the Time Based Aggregator within the process.

  4. In the Increment field, enter the time increment for the Time Based Aggregator to perform the analysis.

  5. In the Size field, enter the time range for the Time Based Aggregator to perform the analysis.

  6. In the Expression box, enter the expression for the SQL SELECT statement to specify the input attribute upon which the SELECT is performed. Add attribute names, data types. and sizes, as applicable.

  7. In the From box, define the input on which to perform the selection.

  8. In the Where clause box, provide additional filtering on records.

    For example:

    WHERE price > 30.00 AND stockDate < '2006-01-01' ;

  9. In the Group by box, group a result into subsets that have matching values for one or more columns of the database by specifying a comma-separated list of qualified attribute names.

  10. Click OK.