Skip to content

Aggregating rules

Aggregating rules combine many values into one.

aggregation

  • Avg — Returns the mean of the given parameters or inputs, folding ARRAY inputs element-by-element.
  • Count — Returns the number of non-NULL values among the given parameters or inputs, counting ARRAY elements individually.
  • IgnoreValue — Removes a single input value from the rule logic context.
  • Max — Returns the largest value among the given parameters or inputs, folding ARRAY inputs element-by-element.
  • Min — Returns the smallest value among the given parameters or inputs, folding ARRAY inputs element-by-element.
  • Selector — Picks one of two values based on a boolean or a comparison between two values.
  • SetValue — Emits the supplied parameter value as the output.
  • Sum — Returns the sum of the given parameters or the available inputs, folding ARRAY inputs element-by-element.
  • Unique — Deduplicates values from one or more inputs; in new mode also flattens ARRAY inputs into one ARRAY.
  • Use — Selects which field or local variable becomes the output of the rule chain.

arithmetic

  • Add — Adds all values given to the rule.
  • AsDays — Converts an integer number of seconds into the equivalent number of days.
  • AsHours — Converts an integer number of seconds into the equivalent number of hours.
  • AsMinutes — Converts an integer number of seconds into the equivalent number of minutes.
  • AsMonths — Converts an integer number of seconds into the equivalent number of months.
  • AsSeconds — Returns the input value (in seconds) unchanged — completes the time-unit set.
  • AsYears — Converts an integer number of seconds into the equivalent number of years.
  • Divide — Divides a dividend by all subsequent values or all available inputs.
  • Multiply — Multiplies all values given to the rule, or all available inputs.
  • Subtract — Subtracts the remaining values from the first, with date- and float-aware promotion.

array

  • Append — Concatenates two or more ARRAY inputs into a single ARRAY, preserving order.
  • CartesianOf — Cartesian product of N input ARRAY values, returning an ARRAY of nested-ARRAY combinations.
  • Fill — Creates an ARRAY of count copies of value.
  • Size — Returns the number of elements in an ARRAY value as an INT.
  • Spawn — Expands an ARRAY value into individual rows, fanning the chain out to one row per element.
  • Tuple — Packs two or more named fields into a single TUPLE value (or ARRAY<TUPLE> when any input is an ARRAY).
  • TupleGet — Extracts the element at the given 0-based index from a TUPLE-valued field.
  • Without — Set difference of two ARRAY inputs — elements of :source not present in :exclude.

cdm-helpers

  • AutoGenId — Generates a sequence of unique identifiers, optionally sized by another multi-sized field.
  • GetCDMFieldValue — Returns the value of another field on the same CDM table.
  • GetCDMValue — Looks up a field's value on another CDM table by an exact (optionally composite) key.
  • GetCDMVisitId — Looks up a visit id on a named CDM table by key with the narrowest matching date interval.
  • GetEnvironmentValue — Reads a value from the engine's environment database and returns it as a STRING.
  • NumberOfResults — Returns the number of results produced by a sibling field, or by the current execution context.

comparison

  • Equal — Returns TRUE when all values (parameters or inputs) are equal.
  • GreaterThan — Returns TRUE when each parameter is strictly greater than the next.
  • GreaterThanOrEqual — Returns TRUE when each parameter is greater than or equal to the next.
  • LessThan — Returns TRUE when each parameter is strictly less than the next.
  • LessThanOrEqual — Returns TRUE when each parameter is less than or equal to the next.
  • NotEqual — Returns TRUE when all values (parameters or inputs) are different.

date

  • Days — Converts a number of days into the corresponding number of seconds.
  • Hours — Converts a number of hours into the corresponding number of seconds.
  • MergeDate — Combines several integer or date components into a single date.
  • Minutes — Converts a number of minutes into the corresponding number of seconds.
  • Months — Converts a number of months into the corresponding number of seconds (30-day months).
  • Seconds — Returns the input number of seconds unchanged — completes the time-unit set.
  • Years — Converts a number of years into the corresponding number of seconds (365-day years).

logical

  • And — Boolean AND across all parameters or all available inputs.
  • Or — Boolean OR across all parameters or all available inputs.

string

  • Concat — Concatenates any number of strings, mixing field references and static literals.