RANGE_MAX

Compute the maximum value for a given property within a time window defined by a start date and an end date.

Usage

RANGE_MAX(eventListName, propertyName, startDate, endDate)

Parameters

eventListName

String

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

propertyName

String

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

startDate

DateTimeString

The date we should start computing the maximum from.

endDate

DateTimeString

The date and time we should stop computing the maximum to.

Returns

Number

Examples

RANGE_MAX(‘MyColl’, ‘Temp’, ‘2021-03-04’, ‘2021-03-15’)

Maximum of Temp for events in MyColl fired between 3/4/21 and 3/15/21.

RANGE_MAX(‘MyColl’, ‘Temp’, ‘2021-03-04’, GET_CURRENT_TIME())

Maximum of Temp values for events in MyColl fired between 3/4/21 and now.

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.