AVERAGES
- Last UpdatedMar 03, 2025
- 1 minute read
The AVERAGES() function calculates the statistical average value of a stream.
When using AVERAGES() in a query, if no resolution is specified then the query returns an error.
Note: This is the preferred method for calculating averages from discrete samples, such as those from a checkweigher, but for most measurements, using AVERAGE is preferred.
Syntax
|
Format |
Stream = AVERAGES( Stream, TimeInterval ) |
|
Arguments |
Stream - A time-ordered vector of values TimeInterval - The time interval over which average values are calculated |
|
Description |
Returns the statistical average a stream over the specified time interval. 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 weight of items coming off a line at 10 minute intervals.
AVERAGES(Line3.ItemWeight, 10 Minute)
Example 2
The following expression returns the average weight of all streams that include "ItemWeight" in their tag name at 10 minute intervals.
AVERAGES(SELECT("TagName","ItemWeight"), 10 Minute)