Creating a metric that uses a grouping function

Metrics are objects that represent business measures and key performance indicators. From a practical perspective, metrics are the calculations performed on data stored in your database, the results of which are displayed on a report. Metrics are similar to formulas in spreadsheet software. For a brief overview of metrics, see About metrics.

Grouping functions aggregate your data. They are your basic functions, such as Sum, Average, First, and Maximum.  When you create a metric that uses a grouping function, you can add the following components to your metric:

Level: By default, metrics are evaluated at the level of the attributes on the report; this is called the report level. For example, a net sales metric is set to the report level by default. When this metric is placed on a report containing Region, the metric calculates regional net sales. When it is placed on a report containing Customer, the net sales is calculated for each customer. You can set the level within the metric, allowing you to specify the attribute to use in the metric calculation, regardless of what is contained on any report the metric is placed on. For a more detailed description, including examples and the elements of a metric level, see Level metrics: Modifying the context of data calculations.

Condition: A condition is a metric filter that is independent of the filters on any reports the metric is used in. A conditional metric allows you to apply a filter to only one metric on a report while not affecting the other metrics. The metric condition can be either a filter or a prompt that returns a list of filters. Only one filter or prompt can be associated with each metric, but that filter can contain multiple qualifications. For example, a conditional metric can calculate net sales for only the Northeast region. When placed on a report with Item, the net sales amount is displayed for only Northeast for each of the items. For a more detailed description, including examples, see Conditional metrics: Filtering data calculations.

Transformation: Transformations allow you to apply an attribute-element offset for fact-comparison purposes. Although transformations can be applied to any attribute hierarchy, the Calendar hierarchy is used most often. For the Calendar hierarchy, the difference can be set as a fixed number of days, weeks, months or years. For example, a transformation metric can calculate last year's net sales. In 2012, that displays 2011 net sales, but in 2011 that displays 2010 net sales. For a more detailed description, including an example, see Conditional metrics: Filtering data calculations.

The Net Sales metric uses the grouping function Sum to aggregate the data from the Net Sales fact.

 

To create a metric that uses a grouping function:

If you have not already selected the metric function and opened the Metric Function Editor, complete the following steps:

  1. From the Home page, click the right arrow next to Create Dashboard. A pop-up menu is displayed. Click the New Metric icon. The Select a Function or Template dialog box opens.

  2. Select the grouping function (such as Sum or Average) by doing one of the following:

  1. Click OK to add the function to the metric. The Function Editor opens.

Note: The expression of a metric is what the function is applied to. The expression can be a fact, an attribute, or another metric.

  1. Specify the expression by doing one of the following:

Add level, condition, and transformation (optional)

You can either complete the metric or add a level, condition, and transformation, as described below:

Complete the metric

  1. You can format the metric header and the metric values. Formatting includes how numeric values are displayed, font styles and sizes, and cell display colors. This formatting is used for the particular metric, regardless of the report on which it is placed. For steps, see Format Metric dialog box.

  1. You can select the functions that can be used to total the metric on a report. For steps, see Advanced Metric Options dialog box: Subtotals.

  2. You can select the function used for dynamic aggregation, which is the rollup of metric values that occurs when an attribute is moved from the report grid to the Report Objects. For steps, see Advanced Metric Options dialog box: General.

  3. Click Save to save your changes. The Save As dialog box opens.

  4. Navigate to the folder where you want to save the metric. Type a Name and Description for the metric, and click OK. Your new metric is saved, and you are returned to the Function Editor.

Related topics

About metrics for a brief overview of metrics

Format Metric dialog box for steps to format a metric

Advanced Metric Options dialog box for descriptions of advanced metric settings, such as dynamic aggregation and subtotal functions, VLDB properties, metric aliases, and the metric join type

 

 

_____________________________