Average Aggregate
The purpose of Average aggregation is to find the average value for a given time interval. It adds up the values of all good raw data in a specified time interval. The sum is then divided by the number of good values. Bad values are ignored in the computation.
If the user specifies a time range where no good data exists for an interval, the quality of the aggregate for that interval will be bad, OPCHDA_NODATA.
This aggregate returns the timestamp of the start of the interval.
Example 1
Start: Jan-01-2002 12:00:10 End: Jan-01-2002 12:00:20 Interval: 00:00:05
Timestamp | Value | Quality |
---|---|---|
Jan-01-2002 12:00:10 | 10 | Calculated, Good |
Jan-01-2002 12:00:15 | 0 | No Data, Bad |
Example 2
Start: Jan-01-2002 12:00:35 End: Jan-01-2002 12:01:00 Interval: 00:00:05
Timestamp | Value | Quality |
---|---|---|
Jan-01-2002 12:00:35 | 0 | No Data, Bad |
Jan-01-2002 12:00:40 | 0 | Bad data in the interval |
Jan-01-2002 12:00:45 | 0 | No Data, Bad |
Jan-01-2002 12:00:50 | 50 | Calculated, Good |
Jan-01-2002 12:00:55 | 0 | No Data, Bad |