Operators and operands for scripted definitions
Create your scripted definitions using the following syntax.
Aggregation operators
Aggregation operators are available only for measures.
Average (AVG)
Calculates the average of all matching field values.
AVG(field: string[, considerDistinct[=(true|false)]])
The following syntax applies to enhanced scripted measures only!
AVG(field: string[, FILTER(filter: Filter)][, (considerDistinct|ignoreGlobalFilter|ignoreDimensions)[=(true|false)]]*)
Count (CT)
Calculates the count of all matching field values.
CT(field: string[, considerDistinct[=(true|false)]]) CT(field: string[, FILTER(filter: Filter)][, (considerDistinct|ignoreGlobalFilter|ignoreDimensions)[=(true|false)]]*)
Count distinct values (CTD)
Calculates the count distinct values of all matching field values.
CTD(field: string) CTD(field: string[, FILTER(filter: Filter)][, (ignoreGlobalFilter|ignoreDimensions)[=(true|false)]]*)
Maximum (MAX)
Calculates the maximum of all matching field values.
MAX(field: string) MAX(field: string[, FILTER(filter: Filter)][, (ignoreGlobalFilter|ignoreDimensions)[=(true|false)]]*)
Minimum (MIN)
Calculates the minimum of all matching field values.
MIN(field: string) MIN(field: string[, FILTER(filter: Filter)][, (ignoreGlobalFilter|ignoreDimensions)[=(true|false)]]*)
Median(MED)
Calculates the median of all matching field values.
MED(field: string) MED(field: string[, FILTER(filter: Filter)][, (ignoreGlobalFilter|ignoreDimensions)[=(true|false)]]*)
Standard deviation (STDDEV)
Calculates the standard deviation of all matching field values.
STDDEV(field: string) STDDEV(field: string[, FILTER(filter: Filter)][, (ignoreGlobalFilter|ignoreDimensions)[=(true|false)]]*)
Sum (SUM)
Calculates the sum of all matching field values.
SUM(field: string[, considerDistinct[=(true|false)]]) SUM(field: string[, FILTER(filter: Filter)][, (considerDistinct|ignoreGlobalFilter|ignoreDimensions)[=(true|false)]]*)
No aggregation (NOAGGR, only supported in legacy mode)
Does not aggregate the values.
NOAGGR(field: string)
Ratio (RATIO, only supported in legacy mode)
Calculates the ratio of all matching field values. User-defined aggregation rule that allows to calculate the ratio of a measure for specific cases or activities relative to other cases or activities.
RATIO(aggregation(field: string), condition[, considerDistinct[=(true|false)]])
You can find various examples of using the RATIO operator in the Script examples chapter.
Flags
IGNORE_DIMENSIONS
Calculates the aggregation without taking any dimensions from the query into account, therefore resulting in a single value per component.
SUM("_ARIS.Case"."Number of cases", ignoreDimensions)
IGNORE_GLOBAL_FILTERS
Calculates the aggregation without taking the global filters into account.
AVG("_ARIS.Case"."Case duration", ignoreGlobalFilters)
CONSIDER_DISTINCT
Calculates the aggregation by considering each encountered row of the fact table only once. For more details, see the chapter Consider objects distinct.
SUM("factTable","amount", considerDistinct)
Arithmetic
Combines two values.
/ | * | - | +
AVG("_ARIS.Activity"."Activity duration") + AVG("_ARIS.Activity"."Activity wait time")
Filters
Defines a filter that is applied to the query additionally. You can attach multiple filters by means of a comma.
FILTER(filter: Filter)
AVG("_ARIS.Case"."Case duration", FILTER(VALUE_MATCHES("_ARIS.Case"."Color", 'green')))
Filter operators
You find more information on the supported filter operators and their use in the Scripting operators and operands chapter.
Operator type | Subtype | Description | Example |
|---|---|---|---|
Field filter | VALUE_MATCHES | Defines a filter that exactly matches field values. | VALUE_MATCHES("_ARIS.Case"."Color", 'green', 'blue') |
Range filter | VALUE_GREATER_THAN | VALUE_LESS_THAN | Define a filter that compares the field value with a numeric or date value. | VALUE_GREATER_THAN("_ARIS.Case"."Costs", 10000) |
VALUE_BETWEEN | Defines a filter that compares the field value with a numeric or date range. The upper limit is exclusive. | VALUE_BETWEEN("_ARIS.Case"."Case start time", DATE(2023-01-01) - Date(2024-01-01)) | |
Path filter | DIRECTLY_FOLLOWED_BY | Defines a filter that compares all cases with the specified activity sequence occurring. The second activity must follow the first activity. | DIRECTLY_FOLLOWED_BY('Activity A', 'Activity B') |
EVENTUALLY_FOLLOWED_BY | Defines a filter that compares all cases with the specified activity sequence occurring. The second activity must eventually follow the first activity. | EVENTUALLY_FOLLOWED_BY('Activity A', 'Activity B') | |
Activity filter | CASE_STARTS_WITH | Defines a filter that compares all cases that start with any of the provided activities. | CASE_STARTS_WITH('Activity A', 'Activity B') |
CASE_PASSES_THROUGH | Defines a filter that compares all cases that pass through ALL of the provided activities. | CASE_PASSES_THROUGH('Activity A', 'Activity B') | |
CASE_PASSES_THROUGH_ANY | Defines a filter that compares all cases that pass through any of the provided activities. | CASE_PASSES_THROUGH_ANY('Activity A', 'Activity B') | |
CASE_ENDS_WITH | Defines a filter that compares all cases that end with any of the provided activities. | CASE_ENDS_WITH('Activity A', 'Activity B') | |
Not | NOT | Inverts the specified filter. | NOT(VALUE_MATCHES("_ARIS.Case"."Color", 'green', 'blue')) |
Null | NULL_NUMBER | NULL_TEXT | NULL_DATE | Null values can be used as constant values. | VALUE_MATCHES("_ARIS.Case"."Color", NULL_TEXT) |
Granularity
Specifies a granularity for a date field.
CTD(YEARS("_ARIS.Case"."Case start time"))
Seconds
Granularity of seconds
SECONDS(field: Field)
Minutes
Granularity of minutes
MINUTES(field: Field)
Hours
Granularity of hours
HOURS(field: Field)
Days
Granularity of days
DAYS(field: Field)
Weeks
Granularity weeks
WEEKS(field: Field)
Months
Granularity of months
MONTHS(field: Field)
Years
Granularity of years
YEARS(field: Field)
General operators and operands
Text constant
Defines a text constant that can be used as a value.
<Text>
'Activity A'
Number constant
Defines a number constant that can be used as a value.
<Number>
1000
Date constant
Defines a date constant that can be used as a value.
DATE(<Date>)
DATE(2024-12-24 12:21:33)
Field
Reference a field and optionally provide parameterized values.
FIELD(field: Field, parameterValue1, parameterValue2, ...)
System field
Reference a system field.
SYSTEM(field: Field)
Custom field
Reference a non-system field.
CUSTOM(field: Field)