Reference to the any() function


any(<timeWindow>, <tsExpression>)

Returns 1 if the expression has been non-zero at any time during the time window. Otherwise, returns 0.


timeWindow Amount of time in the moving time window. You can specify a time measurement based on the clock or calendar (1s, 1m, 1h, 1d, 1w), the window length (1vw) of the chart, or the bucket size (1bw) of the chart. Default is minutes if the unit is not specified.
tsExpression Expression that describes the condition to be tested for.


The any() function enables you to emulate an alert window and helps you predetermine how often an alert would fire based on existing data within a shifting time window.

The any() function looks at the displayed point buckets within a specified moving time window and:

  • Returns 0 if no displayed point buckets meet the specified condition.
  • Returns 1 if at least one of the displayed point buckets meets the specified condition.

Note: You can use all() to test whether all displayed point buckets meet the condition.


The following example checks whether the number of failures for app-19 is greater than the number of failures for app-5 at during a 5 minute time window and returns 1 if it is.

any example