用于汇总整个数据集所有事件值的函数。
了解全局聚合
与仅在单个案例中计算的案例聚合不同,全局聚合会跨数据集中的所有事件进行计算。您可以用它来:
- 计算总体总和与平均值
- 将单个事件或案例与全局基准进行比较
- 计算占总量的比例
常见用法
-
总体统计:
allSum(Revenue) // Total revenue
allAvg(ProcessingTime) // Average processing time
allCount() // Total number of events
-
占总量的比例:
caseSum(Amount) / allSum(Amount) * 100 // This case as % of total
Amount / allSum(Amount) * 100 // This event as % of total
-
与平均值比较:
Duration - allAvg(Duration) // Difference from average
Duration / allAvg(Duration) // Ratio to average
-
筛选后的全局聚合:对部分数据进行聚合计算:
allSumIf(Amount, Region == "Europe") // European total
allAvgIf(Duration, Priority == "High") // High-priority average
allCountIf(Status == "Completed") // Completed count
-
识别异常值:
if(Duration > allAvg(Duration) + 2 * allStdDev(Duration),
"Outlier", "Normal")
allSum
(attribute) 对数据集中所有事件的数值属性求和。
| 参数 | |
| 返回值 | 数字 |
| 示例 | allSum(Revenue) → 所有案例的总收入 |
allAvg
(attribute) 计算数据集中所有事件的属性平均值。
| 参数 | | attribute | number | 要求平均值的属性 | |
| 返回值 | 数字 |
| 示例 | allAvg(ProcessingTime) → 总体平均处理时间 |
allMin
(attribute) 返回数据集中所有事件的最小值。
| 参数 | | attribute | number | 要返回最小值的属性 | |
| 返回值 | 数字 |
| 示例 | allMin(StartTime) → 数据中的最早时间戳 |
allMax
(attribute) 返回数据集中所有事件的最大值。
| 参数 | | attribute | number | 要返回最大值的属性 | |
| 返回值 | 数字 |
| 示例 | allMax(Amount) → 数据中的最高金额 |
allMedian
(attribute) 返回数据集中所有事件的属性中位数。
| 参数 | | attribute | number | 要返回中位数的属性 | |
| 返回值 | 数字 |
| 示例 | allMedian(Duration) → 所有时长的中间值 |
allStdDev
(attribute) 计算数据集中所有事件值的标准差。
| 参数 | |
| 返回值 | 数字 |
| 示例 | allStdDev(ProcessingTime) → 处理时间的标准差 |
allCountDistinct
(expr) 统计数据集中所有事件的不同值数量。
| 参数 | |
| 返回值 | 数字 |
| 示例 | allCountDistinct(Resource) → 不同资源的数量 |
allSumIf
(attribute, condition) 对所有符合条件的事件值求和。
| 参数 | | attribute | number | 要求和的属性 | | condition | boolean | 筛选条件 | |
| 返回值 | 数字 |
| 示例 | allSumIf(Amount, Region == "Europe") → 欧洲案例的总金额 |
allAvgIf
(attribute, condition) 计算所有符合条件的事件值的平均值。
| 参数 | | attribute | number | 要求平均值的属性 | | condition | boolean | 筛选条件 | |
| 返回值 | 数字 |
| 示例 | allAvgIf(Duration, Priority == "High") → 高优先级项目的平均时长 |
allCountIf
(condition) 统计所有符合条件的事件数。
| 参数 | |
| 返回值 | 数字 |
| 示例 | allCountIf(Status == "Completed") → 已完成事件数 |
allMinIf
(attribute, condition) 返回所有符合条件的事件中的最小值。
| 参数 | | attribute | number | 要返回最小值的属性 | | condition | boolean | 筛选条件 | |
| 返回值 | 数字 |
| 示例 | allMinIf(Price, Category == "Premium") → 高端类别的最低价格 |
allMaxIf
(attribute, condition) 返回所有符合条件的事件中的最大值。
| 参数 | | attribute | number | 要返回最大值的属性 | | condition | boolean | 筛选条件 | |
| 返回值 | 数字 |
| 示例 | allMaxIf(Duration, Activity == "Approval") → 最长审批时长 |
统计函数
用于分析所有事件值分布情况的统计函数。
-
识别性能层级:
百分位数以0到1之间的小数表示(0.25=第25百分位):
if(Duration < allPercentile(Duration, 0.25), "Fast",
if(Duration < allPercentile(Duration, 0.75), "Normal", "Slow")
)
-
查找异常值:超出均值两个标准差的值:
if(abs(Amount - allAvg(Amount)) > 2 * sqrt(allVariance(Amount)),
"Outlier", "Normal")
-
与基准对比:
Duration > allPercentile(Duration, 0.9) // Is this in the top 10% (slowest)?
allPercentile
(attribute, percentile) 计算某个属性在所有事件中的百分位数。
| 参数 | | attribute | number | 要分析的属性 | | percentile | number | 百分位数,以0到1之间的小数表示(0.95 = 第95百分位数) | |
| 返回值 | 数字 |
| 示例 | allPercentile(Duration, 0.95) → 总体时长的第95百分位数 |
allVariance
(attribute) 计算某个属性在所有事件中的方差。
| 参数 | |
| 返回值 | 数字 |
| 示例 | allVariance(Amount) → 所有事件金额的方差 |
相关主题