このページの内容

グローバル集計関数

データセット全体のすべてのイベントにわたって値を集計する関数です。

グローバル集計の概要

ケース集計が1つのケース内で処理されるのに対し、グローバル集計はデータセット内のすべてのイベントを対象に計算します。これにより、次の処理が可能になります。

  • 全体の合計と平均の計算
  • 個々のイベントやケースと全体のベンチマークとの比較
  • 全体に占める割合の計算

よく使うパターン

  • 全体の統計:

    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)

データセット内のすべてのイベントについて、数値属性を合計します。

パラメーター
attribute number 合計する属性
戻り値 数値
allSum(Revenue) すべてのケースのRevenue合計

allAvg

(attribute)

データセット内のすべてのイベントの平均を計算します。

パラメーター
attribute number 平均する属性
戻り値 数値
allAvg(ProcessingTime) 全体の平均ProcessingTime

allMin

(attribute)

データセット内のすべてのイベントの最小値を返します。

パラメーター
attribute number 最小値を求める属性
戻り値 数値
allMin(StartTime) データ内で最も早いTimestamp

allMax

(attribute)

データセット内のすべてのイベントの最大値を返します。

パラメーター
attribute number 最大値を求める属性
戻り値 数値
allMax(Amount) データ内で最も高いAmount

allCount

()

データセット内のイベント総数を返します。

戻り値 数値
allCount() イベント総数

allMedian

(attribute)

データセット内のすべてのイベントの中央値を返します。

パラメーター
attribute number 中央値を求める属性
戻り値 数値
allMedian(Duration) すべてのDurationの中央値

allStdDev

(attribute)

データセット内のすべてのイベントの標準偏差を計算します。

パラメーター
attribute number 分析する属性
戻り値 数値
allStdDev(ProcessingTime) ProcessingTimeの標準偏差

allCountDistinct

(expr)

データセット内のすべてのイベントについて、重複しない値を数えます。

パラメーター
expr any 値の式
戻り値 数値
allCountDistinct(Resource) 一意のResourceの数

allSumIf

(attribute, condition)

条件に一致するすべてのイベントの値を合計します。

パラメーター
attribute number 合計する属性
condition boolean 絞り込む条件
戻り値 数値
allSumIf(Amount, Region == "Europe") EuropeのケースのAmount合計

allAvgIf

(attribute, condition)

条件に一致するすべてのイベントの値を平均します。

パラメーター
attribute number 平均する属性
condition boolean 絞り込む条件
戻り値 数値
allAvgIf(Duration, Priority == "High") 優先度がHighの項目の平均Duration

allCountIf

(condition)

条件に一致するすべてのイベントを数えます。

パラメーター
condition boolean 数える条件
戻り値 数値
allCountIf(Status == "Completed") Completedイベントの数

allMinIf

(attribute, condition)

条件に一致するすべてのイベントの最小値を返します。

パラメーター
attribute number 最小値を求める属性
condition boolean 絞り込む条件
戻り値 数値
allMinIf(Price, Category == "Premium") Premiumの最低Price

allMaxIf

(attribute, condition)

条件に一致するすべてのイベントの最大値を返します。

パラメーター
attribute number 最大値を求める属性
condition boolean 絞り込む条件
戻り値 数値
allMaxIf(Duration, Activity == "Approval") 最長のApproval Duration

統計関数

すべてのイベントにおける値の分布を分析する統計関数です。

  • パフォーマンス層の特定:

    パーセンタイルは0から1の分数で指定します(0.25=25パーセンタイル)。

    if(Duration < allPercentile(Duration, 0.25), "Fast",
       if(Duration < allPercentile(Duration, 0.75), "Normal", "Slow")
    )
  • 外れ値の検出:平均から標準偏差2つ分を超える値。

    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) 全体のDurationの95パーセンタイル値

allVariance

(attribute)

すべてのイベントを対象に属性の分散を計算します。

パラメーター
attribute number 分析する属性
戻り値 数値
allVariance(Amount) すべてのイベントのAmountの分散

関連トピック