Create and Save a Metric

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

Your GoodData Demo Workspace comes with a number of metrics, 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.

Create Your First Metric

In the following tutorial, you will create a simple # of Canceled Orders metric.

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 Create Metric window opens.

  4. Enter the name of the metric. For the purpose of this tutorial, enter # of Canceled Orders.

  1. Now you will create the formula for your first metric.  SELECT # of Orders WHERE 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.
  2. Click the Add button in the bottom right corner. A page with the metric’s details opens. The following animation demonstrates the procedure:

Click Data to return to your Data overview page. Your new metric appears in the Metrics list.

Create Additional Metrics

Click the + Create Metric button again to create the following metrics 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 metrics work in Analytical Designer.