Edit

Share via


around()

Applies to: ✅ Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

Creates a bool value indicating if the first argument is within a range around the center value.

Syntax

around(value,center,delta)

Learn more about syntax conventions.

Parameters

Name Type Required Description
value int, long, real, datetime, or timespan ✔️ The value to compare to the center.
center int, long, real, datetime, or timespan ✔️ The center of the range defined as [(center-delta) .. (center + delta)].
delta int, long, real, datetime, or timespan ✔️ The delta value of the range defined as [(center-delta) .. (center + delta)].

Returns

Returns true if the value is within the range, false if the value is outside the range. Returns null if any of the arguments is null.

Examples

The following example filters rows around specific timestamp.

range dt 
    from datetime(2021-01-01 01:00) 
    to datetime(2021-01-01 02:00) 
    step 1min
| where around(dt, datetime(2021-01-01 01:30), 1min)

Output

dt
2021-01-01 01:29:00.0000000
2021-01-01 01:30:00.0000000
2021-01-01 01:31:00.0000000