AVERAGE
- Last UpdatedMar 03, 2025
- 1 minute read
The AVERAGE() function calculates the time-weighted average value of a stream.
When using AVERAGE() in a query, if no resolution is specified then the behavior is the same as average retrieval mode with no resolution specified; the duration between the start and end times is divided into 100 equal cycles, and the average value is calculated for each cycle.
Syntax
|
Format |
Stream = AVERAGE( Stream ) |
|
Arguments |
Stream - A time-ordered vector of values |
|
Description |
Returns the time-weighted average value of a stream. |
|
Format |
Stream = AVERAGE( Stream, TimeInterval ) |
|
Arguments |
Stream - A time-ordered vector of values TimeInterval - The time interval over which average values are calculated |
|
Description |
Returns the time-weighted average of a stream over the specified time interval, based on local time. The start and end times are rounded to the start and end times of the interval. For example, if the interval is hourly, the time stamps of all values end with "00:00.000". |
Example 1
The following expression returns the average flow rate of a pump.
AVERAGE( Pump101.Flow )
Example 2
The following expression returns the average city temperature over 1 hour intervals.
AVERAGE(PLPWeather.NewYorkTemperature , 1 hour)
