Expression Editor

You can use the Expression Editor to manage the Functions used for the Aggregation of the Measures. Measures are parameters that are used to define analytical data that are visualized in the Charts, Rollups, and Actionable Insights. The Expression Editor provides a graphical user interface that helps you create and edit the Functions.

See the complete list of the available expressions Datamart Query Expressions.

Create Measure

To create a new Measure directly from the list of pre-defined aggregation types follow these steps:

Rollups

  1. Go to Analytics > Rollups > Rollup Settings > Measures > Add Measure.

  2. Select an item from the list.

  3. Click Add Item.

  4. Under Aggregation select the aggregation type.

  5. Click Apply and Refresh.

    How to add Measures in Rollups
    How to add Measures in Rollups

Charts

  1. Go to Analytics > Data Analyzer.

  2. Select a Chart type.

  3. Go to Measures > Add Measure.

  4. Select an item from the list.

  5. Click Add Item.

  6. Under Aggregation select the aggregation type.

  7. Click Apply and Refresh.

    How to add Measures in Charts
    How to add Measures in Charts

Edit Measure

You can edit an existing pre-defined Measure using the Expression Editor.

Rollups

  1. Go to Analytics > Rollups > Rollup Settings > Measures > Add Measure.

  2. Select an item from the list.

  3. Click Add Item.

  4. Under the Aggregation click { } Function.

  5. You will be presented with the Expression Editor.

Charts

  1. Go to Analytics > Data Analyzer.

  2. Select a Chart type.

  3. Go to Measures > Add Measure.

  4. Select a Chart from the list.

  5. Click Add Item.

  6. Under the Aggregation click { } Function.

  7. You will be presented with the Expression Editor.

Expression Editor Description

Expression Editor Item

Description

Expression Editor Item

Description

Measures

You can select from the dropdown:

  • Measure

  • The aggregated value of the Measure (Sum, Avg, Per-Unit, etc.)

Expression Editor only works with the aggregated values. You need to either select an aggregated value directly from the dropdown or specify aggregation later otherwise you receive the following warning: non-aggregated value used.

Operators

Using the following operators you can define a relation between each aggregated value.

  • Arithmetic

  • Logic

  • Compare

  • String

Functions

You are provided with the following function categories that can be used in your expression.

  • General

  • Aggregation Functions

  • Statistical Aggregation

  • Within Groups

  • SQL

Run

You can test your expression to see if you are getting the expected value. The calculated value will be presented in the Result Preview section.

Visual Editor

You can switch between graphical and text representations of your expression.

When you define an expression for your measure you always need to specify a concrete argument otherwise you receive the following warning: Missing argument.

Expression Examples

Below you can find the most common expression examples.

Cost per Unit

This is a typical example of an expression that has two aggregated SUM values that are divided.

How To

Result

Cost per Unit Percentage

How To

Result

Average Gross Margin

How To

Result

Gross Margin Trend

In this example we already have a Watcher defined. We have two Time Series grouped by Country. The Invoice Date Quarter is used as a Dimension Filter. We want to create a Join Series to track the Gross Margin Trend.

How To

Result

Found an issue in documentation? Write to us.

Â