Average Last
The Average Last algorithm calculates an average value based on:
- The last raw historic value before the start of the resample interval .
- The raw historic values in the resample interval.
To calculate the Average Last value, Geo SCADA Expert:
- Adds up each of the raw historic values in the sample and the last raw historic value before the sample.
- Divides the result of step 1 by the quantity of values used in step 1 (that is, the total number of values (dependent on the Quality filter) in the sample plus 1).
The result of step 2 is the average last value and it has a timestamp that matches the start time of the sample.
The results returned by the algorithm do not depend on the quality of the data. You can choose to filter the data on quality using the Qualities combo box in the Edit Source window (see Configure a Trace)
If there are no values in the sample, the average last value will be the same as the last raw historic value before the sample.
If there is a raw historic value with a timestamp that matches the start of the sample interval exactly, the last raw value is not used. When there are no values in the sample or after the sample, the raw historic value at the start of the interval is used as the average last value.
Example:
For example, lets say a trace is configured to use the Average Last algorithm and is set to have a resample interval of 1M (1 minute). This means that for each 1 minute sample, Geo SCADA Expert will calculate an average last value.
At 10:31, Geo SCADA Expert has to plot an average last value on the trace. To do this, it adds the last raw historic value from before 10:31 to each of the values in the sample (10:31 - 10:32). In this case, the values are:
Timestamp | Raw Historic Value |
---|---|
09:59:55 | 33.40 |
10:31:05 |
29.11 |
10:31:10 |
27.48 |
10:31:20 |
30.32 |
10:31:30 |
30.34 |
10:31:40 |
34.12 |
10:31:50 |
30.43 |
To calculate the average last value, Geo SCADA Expert adds each of the values up to produce the sum total of 215.22. It then divides 215.22 by the quantity of values in the sample (including the last value before the sample) which is 7. The result of 215.22 divided by 7 is 30.74. The average last value that is plotted on the trace for 10:31 is 30.7.