Skip to main content Skip to complementary content

Working with the expression editor

You can add expressions in different ways, depending on you preferences, and with different levels of complexity.

Using a common function in combination with a specific field

You can filter fields and select among the most common aggregation functions at the right-hand side of the Add expression dialog.

  1. Select a table to limit the number of fields to choose from.
  2. Select a field.
  3. Select the aggregation function you want to use.
  4. Click Insert to insert the field and the function into the expression editor.

    Tip noteYou can insert just a field by not selecting an aggregation function.
  5. Click Apply to close the Add expression dialog.

    For a dimension or measure, you continue by adding descriptive data for the dimension or measure.

Adding an expression by typing

  1. Type the expression directly in the expression editor.

    The field names you use in the expression are checked, and the syntax of the expression is validated.

    Tip noteAs you type in the expression editor, the expression is validated continuously. If there is an error, you see a hint about what is incorrect. Additional error information may be available by clicking the icon next to the hint.

    When you type the name of a function in the expression, a tooltip appears that provides information to help you enter the function correctly, including argument names and qualifiers.

    Information noteThe tooltip for some chart functions shows the ALL qualifier. It is recommended that you do not use the ALL qualifier. Instead, use the set expression {1}.

    Each line in the expression editor is numbered and syntax highlighting is used.

  2. Click Apply to close the Add expression dialog.

    For a dimension or measure, you continue by adding descriptive data for the dimension or measure.

Rules for expressions

The following rules apply for chart expressions:

  • All expressions return a number and/or a string, whichever is appropriate.

  • Logical functions and operators return 0 for False, -1 for True. Number-to-string conversions and string-to-number conversions are implicit.

  • Logical operators and functions interpret 0 as False and all else as True.

  • Expressions that cannot be correctly evaluated, for example as a result of incorrect parameters or functions, return NULL.

Detailed syntax help

You can open the online help with the full description of how to use the current function by double-clicking the function name in the expression editor and pressing Ctrl+H on the keyboard. This feature becomes available after having entered the first parenthesis of the expression after the function name.

Information noteThis feature is supported only when using a computer with a keyboard.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!