Configure an aggregate calculation
- Last UpdatedFeb 12, 2024
- 4 minute read
The AVEVA BI Gateway service extracts data from data sources, determines time-slicing, computes aggregates, adds the associated context, and stores this data in the datastore.
You can configure an aggregate calculation by providing a function, return data type, and source data item mapping for calculating the time period and values (using the function).
You can set a refresh rate to specify the frequency at which the measure data will be refreshed at run time. You can also define the update period that allows you to define the time period for which data will be retrieved every time the measure refreshes. The minimal update period you can select is 1 minute, and the maximum is 366 days.
For example, you have a measure configured with an update period of 1 hour, and a refresh rate of 5 minutes. Every 5 minutes, the AVEVA BI Gateway services will query the last hour of data from the source and update the target records in the datastore.
However, if a source record from the previous day is modified, it is not captured by the update period of 1 hour. If the data source records the date or time at which records are modified, you can use the modification period function. When you configure the Modification Period, the AVEVA BI Gateway services will handle the records at the source that have been modified since the last measure refresh, in addition to the records handled by the update period.
Configure an aggregate calculation
-
Click the Edit Calculations button. The Context & Calculations page appears.

-
In the Calculations pane, click a calculation that you want to configure.
-
In the Calculation type list, click Aggregate.
-
Configure the aggregate calculation. In the Aggregate calculation area, do the following:
-
Click Source data items to select a source data item in the Source data item box. The Select source data items dialog box appears. Select a source data item that you want to use in the calculation. The Calculation field and Period field boxes show the source data item fields of the source data item that you select.
-
In the Function list, click a function for the calculation.
The functions Min, Max, Sum, and Avg can be used with AnalogSummary query. The Count function can only be used with ProcessValues query.
-
In the Return type list, click a return data type for the function. The default return data type is Double.
-
In the Calculation field list, click the source data item field that you want to use for the measure calculation based on the function. This is the field that will be used for the data Aggregation.
-
In the Period field list, click the source data item field that will be used to select the source records for a time-slice. For example, the source system stores data values with a timestamp. The Time Stamp field would be used here to query the appropriate records for each of the time-slices.
-
In the Modification field list, click the source data item field that you want to use for the calculation. The default value is set as "None". This default value indicates that the measure data update using a record modification date function is disabled.
The Modification field, selected from the available fields of the source data item, is used as an indication for the source record modification date or time. When the Modification field is specified, the AVEVA BI Gateway service retrieves the measure source records that have been modified since the last update, in addition to the records already covered by the update period interval. The default value (set as "None") indicates that the measure data update using a record modification date feature is disabled.
-
In the Interval list, click the required time interval of the Modification period.
You can enter a time interval value only if you specify a Modification field. You cannot enter a decimal value for the time interval. You can use the modification interval to limit the number of source records that are scanned for record modification dates. This function is useful when there is no index on the record modification date in the source database but only on the Period field. The AVEVA BI Gateway service scans only the source records that have the Period field within the modification interval period. The modification interval is not used if the source database has an index on the Modification field. When the modification interval is not used, you can set its value to zero.
-
In the Unit list, click the required unit of time for the Modification period.
The default value for Unit is Minute. You can select a time interval unit after the Modification field is populated.
-
-
-
Define relationships for the measure in the Context Relationships grid.
-
Click Save.