Expression Editor

The Expression Editor in UA custom fields is where you type an expression manually or select available functions.

Simple Formulas

You can perform basic math in UA, such as add, subtract, multiply and divide data in fields:

  • Addition (+)

  • Subtraction (-)

  • Multiplication (*)

  • Division (/)

  • Equal (=)

Functions

  • Average returns the average across the selected field.

    For example, this function:

    returns:

  • Count returns the number of the entries within the selected field.

    For example, this function:

    returns:

  • Count Distinct returns the number of unique entries within the selected field.

    For example, this function:

    returns:

  • If compares a value in the selected field.

    For example, this function:

    returns:

  • Maximum returns the highest value within the selected field.

    For example, this function:

    returns:

  • Minimum returns the lowest value within the selected field.

    For example, this function:

    returns:

Date Functions

  • Date Difference calculates and returns the duration between two selected date fields.

    For example, this function:

    returns:

  • Date Add / Subtract adds or extracts the specified number of days, months, or years of the selected date field.

    Note: To extract, add the minus sign (-). For example, -5.

    For example, this function:

    returns:

Text functions

  • Substring returns the strings between the start index and end index in the selected field.

    For example, this function:

    returns:

  • Length returns the length of the string in the selected field as an integer value.

    For example, this function:

    returns:

  • Position returns the position of the specified string within the selected field.

    For example, this function:

    returns:

  • Replace replaces one text string with another in the selected field.

    For example, this function:

    returns:

  • Concatenate joins text from separate fields into a new field.

    For example, this function:

    returns: