AvgRun

This function returns a running average of up to the last specified number of values.

Syntax

AvgRun ( number, count )

Remarks

The number parameter specifies the data value for which the running average is to be calculated. The count parameter specifies the number of values to average. Any value that evaluates to –INF, INF, or NAN will be ignored. If there are no valid values stored, this function will return NAN.

Example

The following example will return the running average of up to the last 24 values of the variable Temp_F. (The StartAtOffsetFromNewest function backfills the data set initially to the full 24 values, provided that the data is available in the data source.)

StartAtOffsetFromNewest(24, OrderCollected); AvgRun("Server:CR1000.Hourly.Temp_F",24)