count() (aggregation function)
Returns a count of the records per summarization group (or in total, if summarization is done without grouping).
- Can be used only in context of aggregation inside summarize
- Use the countif aggregation function
to count only records for which some predicate returns
true.
Syntax
count ( )
Returns
Returns a count of the records per summarization group (or in total, if summarization is done without grouping).
Example
Counting events in states starting with letter W:
StormEvents
| where State startswith "W"
| summarize Count=count() by State
| State | Count |
|---|---|
| WEST VIRGINIA | 757 |
| WYOMING | 396 |
| WASHINGTON | 261 |
| WISCONSIN | 1850 |