sample-distinct operator
Returns a single column that contains up to the specified number of distinct values of the requested column.
The operator tries to return an answer as quickly as possible rather than trying to make a fair sample.
Syntax
T | sample-distinct
NumberOfValues of
ColumnName
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
T | string |
✔️ | The input tabular expression. |
NumberOfValues | int, long, or real | ✔️ | The number distinct values of T to return. You can specify any numeric expression. |
ColumnName | string |
✔️ | The name of the column from which to sample. |
Tip
- Use the top-hitters operator to get the top values.
- Refer to the sample operator to sample data rows.
Examples
Get 10 distinct values from a population
StormEvents | sample-distinct 10 of EpisodeId
Sample a population and do further computation without exceeding the query limits in the summarize
let sampleEpisodes = StormEvents | sample-distinct 10 of EpisodeId;
StormEvents
| where EpisodeId in (sampleEpisodes)
| summarize totalInjuries=sum(InjuriesDirect) by EpisodeId
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