LAST_MAX

Compute the minimum value for a given property within a time window between now and a date in the past determined by the provided duration.

Usage

LAST_MAX(eventListName, propertyName, duration)

Parameters

eventListName

String

The name of the event list containing the events to use.

propertyName

String

The name of the property to get an average for. It needs to be a number property.

duration

String

A string representing a duration (expressed in the ISO 8601 format) to determine when to stop the average.

Returns

Number

Examples

LAST_MAX(‘MyColl’, ‘Temp’, ‘P7D’)

Max of Temp for events in MyColl fired in the past 7 days.

LAST_MAX(‘MyColl’, ‘Temp’, ‘GETDURATIONFROMSEC(60)’)

Max of Temp for events in MyColl fired in the past 60 seconds.

LAST_MAX(‘MyColl’, ‘Temp’, ‘PT1H’)

Max of Temp for events in MyColl fired in the past hour.

Remarks

If the provided collection name does not exist, or if no events were fired in the provided time window, the function will return 0.