Striim 3.9.4 / 3.9.5 documentation

Referring to Past Events

If a match on the next event depends on the value of an attribute in a previous event, use the PREV() built-in function. The only parameter is an integer constant indicating how far back to match in the event pattern. For example, PREV() or PREV(1) refers to the immediately preceding event, but PREV(2) refers to the event that occurred before the immediately preceding event. For example:

DEFINE
-- Compare the new event's sensor with the previous event's sensor.
-- The default index value of 1 is used.
A=streamx(sensor < PREV().sensor)  
-- Compare the new event's sensor with the sensor of the event before the previous sensor.
B=streamx(sensor < PREV(2).sensor)