Creating expressions

An expression is a combination of functions, operators, and values. They are used to create calculations, filters, SQL-based tables, and to modify a column's expression.

The expression editor is used to work with expressions in Data Modules, Dashboards, and Explore. It can be invoked from a number of places within these components, as documented in the topic Using the expression editor.

The expression editor provides the following elements to create expressions:

  • Operators

    Operators specify what happens to the values on either side of the operator. Operators are similar to functions in that they manipulate data items and return a result.

  • Summaries

    Predefined functions that return either a single summary value for a group of related values or a different summary value for each instance of a group of related values.

  • Constants

    Fixed values that you can use in an expression.

  • Constructs

    This list contains constructs and templates that can be used to create an expression. Templates combine multiple functions into a group. For example, the search case template includes the case, when, else, and end functions.

  • Business Date/Time functions

    Business functions for performing date and time calculations.

  • Period predicates

    Time period functions that evaluate to either true or false.

  • Vendor Specific Functions

    SQL functions that are specific to databases that Cognos Analytics supports.

  • Common Functions

    Standard SQL functions.

  • Macro Functions

    Functions that can be used within a macro. A macro is enclosed between the number signs (#) at the beginning and at the end. Everything between the number signs is treated as a macro expression, and is executed at run time. A macro can contain one or more macro functions.

All these elements are documented in the expression editor. For more information, see Expression editor documentation.