Aggregating Measurement Data
Aggregating measurement data involves identifying constituent measuring components for an Aggregation Measuring Component, identifying the measurement data that falls within the aggregation period, and aggregating that data. The process varies slightly between interval and scalar measuring components.
Interval Measuring Components
Aggregation of interval measurements is handled by the Aggregate Interval Measurements (D1_AGGINT) algorithm. The algorithm performs the following steps:
-
It calls the Find Constituents for Dynamic Aggregation (D1-FINDCONST) algorithm and populates the GTT1 global temporary table (see Find Constituents for more details about this process).
-
It deletes any constituents from the GTT1 table that do not have 100% coverage for the dates in the aggregation period.
-
For each remaining constituent in GTT1, the algorithm inserts its measurements for the aggregation period into the GTT2 global temporary table. If the SPI and UOM are different from that of the Aggregation Measuring Component, the measurements are converted to a common SPI using Axis Conversion.
-
It performs aggregation calculations on the measurement data in the GTT2 table, using data source template SQL, extended by the value identifiers defined on the measuring component type of the Aggregation Measuring Component.
-
It either inserts or updates the results to the appropriate measurement table (the standard Measurement table, or the Aggregation Measurement table)
-
If there is no data for any dates in the aggregation period and previously aggregated measurements exist, those measurements are deleted to indicate the absence of data.
-
It updates the Most Recent Measurement Date/Time and Latest Measurement Date/Time values on the Aggregation Measuring Component.
Scalar Measuring Components
Aggregation of scalar measurements is handled by the Aggregate Scalar Measurements (D1_AGGSCL) algorithm. The algorithm performs the following steps:
-
It calls the Find Constituents for Dynamic Aggregation (D1-FINDCONST) algorithm and populates the GTT1 global temporary table (see Find Constituents for more details about this process).
-
It deletes any constituents from the GTT1 table that do not have 100% coverage for the dates in the aggregation period.
-
For each remaining constituent in GTT1, the algorithm inserts its measurements for the aggregation period into the GTT2 global temporary table. If the UOM is different from that of the Aggregation Measuring Component, the measurement is converted to a common UOM before being inserted into GTT1.
-
It performs aggregation calculations on the measurement data in the GTT2 table, using data source template SQL, extended by the value identifiers defined on the measuring component type of the Aggregation Measuring Component.
-
It applies a profile to the aggregated scalar values to create interval measurements with the same SPI as the Aggregation Measuring Component.
-
It either inserts or updates the results to the appropriate measurement table (the standard Measurement table, or the Aggregation Measurement table)
-
If there is no data for any dates in the aggregation period and previously aggregated measurements exist, those measurements are deleted to indicate the absence of data.
-
It updates the Most Recent Measurement Date/Time and Latest Measurement Date/Time values on the Aggregation Measuring Component.