count() (aggregation function)
Counts the number of records per summarization group, or total if summarization is done without grouping.
Null values are ignored and don't factor into the calculation.
To only count records for which a predicate returns true
, use countif().
Note
This function is used in conjunction with the summarize operator.
Syntax
count()
Learn more about syntax conventions.
Returns
Returns a count of the records per summarization group, or in total if summarization is done without grouping.
Example
This example returns a count of events in states:
StormEvents
| summarize Count=count() by State
Output
State | Count |
---|---|
TEXAS | 4701 |
KANSAS | 3166 |
IOWA | 2337 |
ILLINOIS | 2022 |
MISSOURI | 2016 |
GEORGIA | 1983 |
MINNESOTA | 1881 |
WISCONSIN | 1850 |
NEBRASKA | 1766 |
NEW YORK | 1750 |
... | ... |
Related content
- bin_at() rounds values down to a fixed-size bin, which can be used to aggregate data, such as by time unit.
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om