Scalar. Determines whether or not the value in a given column crosses a specified threshold.
This function returns True if the value in the specified column of the current row is greater than value after having been less than or equal to value in the previous row (for UP), or less than value after previously being greater than or equal to value (for DOWN), or either (for ANY). Note that this function returns True for the first row in a stream or window if the value of the specified column is greater than value (for UP), less than value (for DOWN), or not equal to value (for ANY).
If using this function for a window partitioned with GROUP BY or PER, the threshold comparison applies to each partition individually, not the window as a whole.
The following example query publishes a row to its destination stream when the value of the Trades.Price column exceeds 100:
INSERT INTO OutStream SELECT Symbol, Price, Volume FROM Trades WHERE THRESHOLD(UP, Trades.Price, 100);