MaxRunOverTime

This function returns the maximum of all values whose timestamps are greater than the newest timestamp minus the specified interval.

Syntax

MaxRunOverTime ( number, valueTimestamp, interval)

Remarks

The number parameter specifies the data value for which the maximum is to be calculated. The valueTimestamp is the timestamp for this data value. (The Timestamp function can be used to obtain this timestamp.) The interval parameter is the time interval, in nanoseconds, over which to calculate the maximum. The predefined time constants can be used to easily input the number of nanoseconds in a microsecond (nsecPerUSec), millisecond (nsecPerMSec), second (nsecPerSec), minute (nsecPerMin), hour (nsecPerHour), day (nsecPerDay), or week (nsecPerWeek). The function will buffer any values whose time is within the specified interval. 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 maximum value of the variable Temp_F over the past day. (The StartRelativeToNewest function backfills the data set initially to the full 24 hour interval, provided that the data is available in the data source.)

StartRelativeToNewest(nsecPerDay, OrderCollected); MaxRunOverTime("Server:CR1000.Second.Temp_F",Timestamp("Server:CR1000.Second.Temp_F"),nSecPerDay)