GitHubContribute in GitHub: Edit online

avg() (aggregation function)

Calculates the average (arithmetic mean) of Expr across the group.

  • Can only be used in context of aggregation inside summarize

Syntax

avg (Expr)

Arguments

  • Expr: Expression that will be used for aggregation calculation. Records with null values are ignored and not included in the calculation.

Returns

The average value of Expr across the group.

Example

The following example caluculates the average severity value of the system.

events
| poject severity
| summarize avg(severity)

Results

avg_severity
4.5