删除 95% 的最高计数 Kusto 查询
Remove 95 percent of highest count Kusto Query
我正在尝试通过引荐来源获取列的总计数并删除最高计数的前 95%,并且仅显示引荐来源的最低计数 (5%),有示例吗?
按推荐人汇总计数(id)
其中 count_id <5%
操作方法如下(请注意,在我的示例中,我取第 50 个百分位数,只是因为我不想输入太多数据以获得有意义的第 5 个百分位数:)):
let YourTable = datatable(Name:string, NumCandies:long) [
"John", 10,
"Beth", 20,
"Steven", 30,
"Paul", 40,
"Elsa", 50,
"George", 60,
"Martha", 70
];
let Percentile50 = toscalar(
YourTable
| summarize percentile(NumCandies, 50));
YourTable
| where NumCandies <= Percentile50
这将输出:
| Name | NumCandies |
|--------|------------|
| John | 10 |
| Beth | 20 |
| Steven | 30 |
| Paul | 40 |
|--------|------------|
我正在尝试通过引荐来源获取列的总计数并删除最高计数的前 95%,并且仅显示引荐来源的最低计数 (5%),有示例吗?
按推荐人汇总计数(id) 其中 count_id <5%
操作方法如下(请注意,在我的示例中,我取第 50 个百分位数,只是因为我不想输入太多数据以获得有意义的第 5 个百分位数:)):
let YourTable = datatable(Name:string, NumCandies:long) [
"John", 10,
"Beth", 20,
"Steven", 30,
"Paul", 40,
"Elsa", 50,
"George", 60,
"Martha", 70
];
let Percentile50 = toscalar(
YourTable
| summarize percentile(NumCandies, 50));
YourTable
| where NumCandies <= Percentile50
这将输出:
| Name | NumCandies |
|--------|------------|
| John | 10 |
| Beth | 20 |
| Steven | 30 |
| Paul | 40 |
|--------|------------|