Average Last
The Average Last algorithm calculates an average value based on:
- The last good quality raw historic value before the start of the resample interval
- The good quality raw historic values in the resample interval.
To calculate the Average Last value, ClearSCADA:
- 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 good quality values 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.
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 exactly, and there are no values in the sample or after the sample, the raw historic value 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, ClearSCADA will calculate an average last value.
At 10:31, ClearSCADA 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:
- Value before sample: 33.4
- Sample values: 29.11, 27.48, 30.32. 30.34, 34.12, 30.43.
To calculate the average last value, ClearSCADA 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.