Creating Aggregated Measures

About Aggregated Measures

Aggregated measures enable you to calculate new data items by using aggregated values. For example, you might want to calculate a company’s profits by subtracting expenses from revenues.
Note: To calculate data items by using unaggregated values, see Creating Calculated Data Items.
Aggregations are evaluated as part of the calculation expression. For each data item in your expression, you can select the aggregation type and the context for the aggregation.

Create an Aggregated Measure

Here are the steps to create an aggregated measure:
  1. Select Datathen selectNew Aggregated Measure. The New Aggregated Measure window appears.
  2. Enter a Name for the aggregated measure.
  3. Build the expression for your aggregated measure by dragging and dropping data items, global parameters, and operators onto the expression in the right pane. For each field in the expression, you can insert a data item, a global parameter, an operator, or a specific value.
    Note: You can create a new calculated item to use in the aggregated measure expression. Click New Calculated Item to create the new calculate item.
    When you drag and drop items, global parameters, and operators onto the expression, the precise location of the cursor determines where and how the new element is added to the expression. As you drag the new element over the expression, a preview appears, which displays how the expression would change if you drop the element at the current location.
    There are a large number of operator types available to perform mathematical functions and evaluate logical processing such as IF clauses. See Operators for Data Expressions.
    Note: You can also edit your expression as text. See Editing a Data Expression in Text Mode.
  4. For each data item in your expression, select an aggregation type. By default, Sum is used for measures and Distinct is used for categories. To select a new aggregation type, drag and drop an aggregated operator from the Operators list onto the aggregation type in the expression. See Operators for Data Expressions for a list of the aggregated operators that are available.
  5. For each aggregated operator in your expression, select the aggregation context. A drop-down list beside each aggregation enables you to select one of the following context values:
    ByGroup
    calculates the aggregation for each subset of the data item that is used in a visualization. For example, in a bar chart, an aggregated measure with the ByGroup context calculates a separate aggregated value for each bar in the chart.
    ForAll
    calculates the aggregation for the entire data item (after filtering). For example, in a bar chart, an aggregated measure with the ForAll context uses the same aggregated value (calculated for the entire data item) for each bar in the chart.
    By using the ForAll and ByGroup contexts together, you can create measures that compare the local value to the global value. For example, you might calculate the difference from mean by using an expression like the following:
    Avg ByGroup(X) - Avg ForAll(X)
  6. When you are finished creating your expression, click Select to choose the data format.
  7. Click OK to create the new aggregated measure. The new data item appears in the Data Items pane.

Support for Aggregated Measures

Aggregated measures can be used in the following visualization types: