Create and Save a Calculated Measure

While you can work with measures and calculated measures directly in Analytical Designer, you can also create new ones and customize the existing ones to provide more business context for your users.

In this article, you will use Metric Editor which uses the term metric instead of calculated measure.

Contents:

Your GoodData Demo Workspace comes with a number of calculated measures, for example Order Amount which is defined as Quantity*Price.

The following animation will show you how we created the Order Amount metric using the Advanced Metric Editor. In the following tutorial, you will create a simple # of Canceled Orders calculated measure.

Steps:

1. Go to Manage and in the Data tab, select Metrics.
2. Click + Create Metric.
The Metric Editor page opens.
3. Click Custom metric. The Metric Editor window opens.
4. Enter the name of the calculated measure. For the purpose of this tutorial, enter # of Canceled Orders. 5. Now you will create the formula for your first calculated measure.
SELECT # of Orders WHERE Order Status = Canceled

Select the model elements (facts, attributes, etc.) using the right-hand pane rather than typing them into the editor text box. For example, to select the value “Canceled” for Order Status, go to Attribute Values > Order Status > Canceled.

To construct the formula:

1. Type SELECT in the main text box.
2. On the Elements browser on the right, click Metrics.
The list of metrics appears.
3. Double-click # of Orders.
The element is added to the formula.
4. Type WHERE.
5. Click Attributes.
In the list of attributes, double-click Order Status.
The element is added to the formula.
6. Type =
7. Click Attribute Values, then click Order Status.
The list of values for the Order Status attribute appears.
8. Double click Canceled.
The element is added to the formula.
6. Click the Add button in the bottom right corner.
A page with the metric's details opens. The following animation demonstrates the procedure: Click the + Create Metric button again to create the following calculated measures by repeating the procedure above.

MetricFormula

# of Orders

SELECT COUNT( Order ID )
Average Order AmountSELECT Order Amount / # of Orders
Revenue

SELECT Order Amount
WHERE Order Status = Delivered

You can click the Analyze tab to see how your new calculated measures work in Analytical Designer.