.. _conf.dm.aggregates: ==================== Configure Aggregates ==================== In some cases, raw data needs to be combined and saved in a separate tag for future use. While you can perform these aggregations on demand using services like the Calculation Service or Dashboards, there are situations where you need to save these aggregations for later reporting or further calculations. This is where the aggregation manager and grouping become essential. The aggregation manager helps you define how to process and group your data, ensuring that the necessary calculations are performed and stored correctly. Follow the steps below to define an aggregate group, configuring its properties, and managing the input and output data effectively. 1. Define Aggregate Groups ************************** When you create a new aggregate group, you first define the general data that outlines how the group should be processed. See below for detailed steps: a. Choose :menuselection:`Configuration --> Data Management --> Aggregates` from the menu. b. On the **Aggregates** tab, click |add| **Add** on the toolbar. c. In the **Aggregate Group Configuration** dialog, enter data as follows: .. list-table:: :widths: 1 5 :header-rows: 1 :class: tight-table * - Field - Description * - **Name** - Enter a name that uniquely identifies the group. * - **Description** - Provide additional information about the group's purpose. * - **Aggregate** - Select an option to indicate how data is to be aggregated. Available options include: | **Period-Based Aggregates** (timestamped at start or end of interval): - ``Mean (Period)`` {Interval}: Returns the average for the last full period, or the last partial period if a full one is not available. *Example:* For a 1-hour interval, returns the average from the previous hour. - ``Sum (Period)`` {Interval}: Returns the total for the last full or partial period. *Example:* A 1-hour interval returns the total from the previous hour. - ``Min (Period)`` {Interval}: Returns the minimum value for the previous period, timestamped for the period, not the actual time of the minimum. - ``Max (Period)`` {Interval}: Returns the maximum value for the previous period, timestamped for the period. - ``First (Period)`` {Interval}: Returns the first value for the previous period, timestamped for the period. - ``Last (Period)`` {Interval}: Returns the last value for the previous period, timestamped for the period. - ``Derivative (Period)`` {Interval}: Calculates the rate of change over the last full or partial period. *Example:* For a 1-hour interval, returns the rate of change from the previous hour. - ``Integral (Period)`` {Interval}: Computes the accumulated value over the last full or partial period. *Example:* For a 1-hour interval, returns the integral from the previous hour. **Moving Aggregates**: - ``Moving Average (By Points)`` {Interval, Frequency}: Computes a rolling average over the interval using the last *N* data points. *Example:* A 24-hour interval with 10-point frequency returns the 24-hour average from the last of the previous 10 points. - ``Moving Average (By Time)`` {Interval, Frequency}: Computes a rolling average over the interval using a moving time window. *Example:* A 24-hour interval with a 1-hour frequency returns the 24-hour average from the previous hour. - ``Moving Total (By Time)`` {Interval, Frequency}: Computes a rolling total over the interval using a moving time window. *Example:* A 24-hour interval with a 1-hour frequency returns the 24-hour total from the previous hour. * - **Interval Count** - Specify the interval used for the aggregate. This is used in combination with the Aggregate and the Interval Unit values. For example, a *Mean (By Period)* Aggregate with a *300* Interval Count and *s* Interval Unit will calculate an average every 300 seconds (5 minutes). * - **Interval Unit** - Specify the units of measure to be used for the Interval Count. * - **Aggregate Option** - Select how to handle the quality of the resulting aggregate. The available options are mutually exclusive, you can only select one of the following values: - ``Normal`` (default): All input points are used in the aggregate, with the resulting quality matching the worst quality of the inputs. - ``AssumedGood``: The quality is always set to Good when read from the Data Service Tag/Aggregate. (DataService: *WithAssumedGoodQuality*) - ``WithoutQuality``: Quality is disabled. (DataService: *WithoutQuality*) - ``OnlyGood``: Only good input points are used in the aggregate. If there are no good input points, the last good aggregate is used. If there are no last good aggregates, then nothing is returned. (DataService: *WithOnlyGoodQualities*) - ``MinimumGood``: If you select this value, the **Count Target** field appears, which represents the minimum number of good input points required for the aggregate to be considered good. (DataService: *WithMinimumNumberOfGoodQualitiesInWindow*) * - **Timestamp Location** - Select which time stamp should be used for the resulting aggregate. d. Save your entries. 2. Add IO Records to the Aggregate Group **************************************** Once you have defined the aggregate group, you must determine what data is to be aggregated (input data) and where the result should be stored (output data). You do this by creating IO records for the tags (define input and output tags) under the aggregation group as follows: a. On the **Aggregates** tab, expand the details for the relevant aggregate group by clicking |add| at the start of the row. |one| b. At the top right side of the expanded view area, click |add| next to the *Search* box to add a new entry for input and output tags. |two| c. In the new row that is added, select an input tag |three| and an output tag |four| as required. d. Click |addblue| to save the new entry |five|. .. image:: images/conf.aggregate.io.png .. |add| image:: images/icon.add.png .. |one| image:: images/step_one.png :scale: 50% .. |two| image:: images/step_two.png :scale: 50% .. |three| image:: images/step_three.png :scale: 50% .. |four| image:: images/step_four.png :scale: 50% .. |five| image:: images/step_five.png :scale: 50% .. |addblue| image:: images/icon.add.blue.png