On This Page

Global Aggregate Functions

Functions for aggregating values across all events in the entire dataset.

Understanding Global Aggregates

While case aggregates operate within a single case, global aggregates calculate across all events in the dataset. This enables:

  • Calculating overall totals and averages
  • Comparing individual events or cases to global benchmarks
  • Computing percentages of total

Common Patterns

  • Overall Statistics:

    allSum(Revenue)           // Total revenue
    allAvg(ProcessingTime)    // Average processing time
    allCount()                // Total number of events
  • Percentage of Total:

    caseSum(Amount) / allSum(Amount) * 100   // This case as % of total
    Amount / allSum(Amount) * 100            // This event as % of total
  • Compare to Average:

    Duration - allAvg(Duration)              // Difference from average
    Duration / allAvg(Duration)              // Ratio to average
  • Filtered Global Aggregates: Calculate aggregates for a subset of the data:

    allSumIf(Amount, Region == "Europe")     // European total
    allAvgIf(Duration, Priority == "High")   // High-priority average
    allCountIf(Status == "Completed")        // Completed count
  • Identify Outliers:

    if(Duration > allAvg(Duration) + 2 * allStdDev(Duration), 
       "Outlier", "Normal")

allSum

(attribute)

Sums a numeric attribute across all events in the dataset.

Parameters
attribute number Attribute to sum
Returns number
Examples
allSum(Revenue) → Total revenue across all cases

allAvg

(attribute)

Calculates the average of an attribute across all events in the dataset.

Parameters
attribute number Attribute to average
Returns number
Examples
allAvg(ProcessingTime) → Average processing time overall

allMin

(attribute)

Returns the minimum value across all events in the dataset.

Parameters
attribute number Attribute whose minimum to return
Returns number
Examples
allMin(StartTime) → Earliest timestamp in the data

allMax

(attribute)

Returns the maximum value across all events in the dataset.

Parameters
attribute number Attribute whose maximum to return
Returns number
Examples
allMax(Amount) → Highest amount in the data

allCount

()

Returns the total number of events in the dataset.

Returns number
Examples
allCount() → Total event count

allMedian

(attribute)

Returns the median value across all events in the dataset.

Parameters
attribute number Attribute whose median to return
Returns number
Examples
allMedian(Duration) → Middle value of all durations

allStdDev

(attribute)

Calculates the standard deviation across all events in the dataset.

Parameters
attribute number Attribute to analyze
Returns number
Examples
allStdDev(ProcessingTime) → Standard deviation of processing times

allCountDistinct

(expr)

Counts distinct values across all events in the dataset.

Parameters
expr any Value expression
Returns number
Examples
allCountDistinct(Resource) → Number of unique resources

allSumIf

(attribute, condition)

Sums values across all events that meet a condition.

Parameters
attribute number Attribute to sum
condition boolean Condition to filter by
Returns number
Examples
allSumIf(Amount, Region == "Europe") → Total amount for European cases

allAvgIf

(attribute, condition)

Averages values across all events that meet a condition.

Parameters
attribute number Attribute to average
condition boolean Condition to filter by
Returns number
Examples
allAvgIf(Duration, Priority == "High") → Average duration for high priority items

allCountIf

(condition)

Counts all events that meet a condition.

Parameters
condition boolean Condition to count
Returns number
Examples
allCountIf(Status == "Completed") → Number of completed events

allMinIf

(attribute, condition)

Returns the minimum value among all events that meet a condition.

Parameters
attribute number Attribute whose minimum to return
condition boolean Condition to filter by
Returns number
Examples
allMinIf(Price, Category == "Premium") → Lowest premium price

allMaxIf

(attribute, condition)

Returns the maximum value among all events that meet a condition.

Parameters
attribute number Attribute whose maximum to return
condition boolean Condition to filter by
Returns number
Examples
allMaxIf(Duration, Activity == "Approval") → Longest approval duration

Statistical Functions

Statistical functions for analyzing the distribution of values across all events.

  • Identify Performance Tiers:

    Percentiles are passed as fractions from 0 to 1 (0.25 = 25th percentile):

    if(Duration < allPercentile(Duration, 0.25), "Fast",
       if(Duration < allPercentile(Duration, 0.75), "Normal", "Slow")
    )
  • Find Outliers: Values beyond 2 standard deviations from the mean:

    if(abs(Amount - allAvg(Amount)) > 2 * sqrt(allVariance(Amount)),
       "Outlier", "Normal")
  • Compare to Benchmarks:

    Duration > allPercentile(Duration, 0.9)   // Is this in the top 10% (slowest)?

allPercentile

(attribute, percentile)

Calculates an attribute's percentile across all events.

Parameters
attribute number Attribute to analyze
percentile number Percentile as a fraction from 0 to 1 (0.95 = 95th percentile)
Returns number
Examples
allPercentile(Duration, 0.95) → 95th percentile duration overall

allVariance

(attribute)

Calculates an attribute's variance across all events.

Parameters
attribute number Attribute to analyze
Returns number
Examples
allVariance(Amount) → Variance of amounts across all events

Design better processes. Build a connected architecture. Stay in control.

Get instant access with no credit card and no waiting. Turn the way your organization works into clear, connected process designs.

Build your process architecture, define ownership and controls, and align roles and responsibilities across every level.

Start your free trial and create one reliable foundation for governing, managing, and continuously improving your processes.