Use Expressions

Topics on This Page

The Visualizer Expression Builder helps you add report-level attributes, measures, or filters based on BQLClosed Business Query Language expressions. You can make these available to other reports in the same space using the Make Global option.

The Expression Editor Basic mode displays attributes and measures from multiple subject areas to build your expressions and you can save expressions in either a Custom Subject Area or the Default Subject Area.

Tip: For Visualizer tables, you can use BQLClosed Business Query Language expressions to specify conditional formatting.

The Expression Builder supports a visually-oriented Basic mode and a text-oriented Advanced mode. In Basic mode, the Expression Builder provides type-ahead search to make it easy to add columns, functions, and operators. Use Advanced mode when you want to type a new or copy-paste an existing BQL expression.

Note:Some functions and operators are supported only in Advanced mode.

Expressions you create are available in the Visualizer Subject Area and you can use them like any regular measure or attribute.

Note: By default, report expressions created in Visualizer are only available for the current report; they are not available for use in other reports. You can make an expression available across the space by clicking Make Global. This is also called a saved expression.

Expression filters are display filters and apply against the query result set in memory.

Create an Expression in Expression Builder

  1. In the Visualizer module, click Expression Builder

    . The Visualizer Expression Builder opens.

  2. Name the expression.
    Example: Revenue Expression, a measure that multiplies two existing measures.
  3. Select the expression category. Options include Measure, Attribute, or Filter.
    Example: For Revenue Expression, select Measure.
    • To make an attribute or measure expression available to other reports in the space, click Make Global. These are like "saved expressions" and are listed in the Subject Area for other reports in the space.
    • Filter expressions can be either display filters (applied to the data in memory) or data filters (applied to the data in the database). Data filters can be leveraged for set-based filters.

  4. If you are proficient in BQL or have a pre-existing query, select Advanced mode.
  5. Type or paste the query into the text field and click Done.

    Tip: Use the Functions Reference tab to find the syntax for Advanced mode functions.
  6. In Basic mode, start typing the name of one of the existing measures the Code field. Visualizer provides type-ahead search finds the relevant measures.
  7. Select the Quantity measure.

    The message "Expression is incomplete" displays at the bottom and Done is unavailable until there is a complete expression in the Code field.
  8. Visualizer presents a list of useful operators. Select the operator from the list or type a shortcut such as asterisk (*).

  9. Start typing the name of the next measure and select it. The editor prompts for additional clauses you may need. This example does not require more.

  10. Click the drop-down arrow next to a measure to add Aggregation and By Date information.  For example, Quantity uses the defaults Sum and By Order Date.

  11. For Unit Price, select Avg and leave the default By Order_Date.
  12. Click Done. Visualizer saves the expression and closes the Expression Builder.

Supported Functions and Operators in Expressions

BQL provides many functions and operators for expressions in Visualizer.

Tip: When referencing a variable in BQL, for example in a report expression or an ETL script, use the following function:

GETVARIABLE('variable_name')

Do not use the V{} syntax.

All functions and operators are supported in Advanced mode, with the exception of TRANSFORM. The following subset of BQL functions and operators are supported in the Visualizer Expression Builder Basic Mode:

Add an Expression to a Report

  1. To find an expression, search for it in either Measures or Attributes in the subject area.

  2. Add the expression to your report as you would any other measure or attribute.
    Tip: You can use an expression as a filter by dragging it to the Filters bucket.
  3. Click Save.
    Tip: To edit or delete an expression, navigate to the expression in the Subject Area and click Add.