DURATION (Time in State)
- Last UpdatedAug 17, 2022
- 1 minute read
The DURATION() function returns a stream representing the duration in seconds of each "true" state in an expression.
Syntax
|
Format |
Stream = DURATION( StreamLogicalExpression ) |
|
Arguments |
StreamLogicalExpression - A logical expression to be evaluated |
|
Description |
The logical expression represented by StreamLogicalExpression is evaluated, and a stream is returned representing the duration in seconds of each TRUE state in the results. |
|
Format |
Stream = DURATION( StreamLogicalExpression, Interval ) |
|
Arguments |
StreamLogicalExpression - A logical expression to be evaluated Interval - The time interval over which to calculate durations |
|
Description |
The logical expression represented by StreamLogicalExpression is evaluated, and a stream is returned representing the duration in seconds of each TRUE state in the results, with durations being split across the specified time period. For example, if StreamLogicalExpression evaluates to a TRUE value for a time period of 07:55-08:10, and the specified Interval is hourly, the output contains one "5 minute" and one "10 minute" result. Without specifying an Interval, the output would instead contain one "15 minute" result. |