Averages and Aggregation

GoodData Analytical Designer allows you to simply combine multiple metrics with multiple attributes within your logical data model. Even when you create complex MAQL expressions, you can do so without joins or GROUP BYs.

In this following example, the insight shows the average revenue per customer, further sliced by Category. This metric (calculated measure) Revenue per Customer is included in your demo workspace defined as SELECT AVG(SELECT Revenue BY CUSTOMER ID).

To create the insight as displayed, review the animation and follow the guide.

  1. Go to the Analytical Designer (click the Analyze tab).
  2. Drag the Revenue per Customer calculated measure to MEASURES.
  3. Drag Product Category to View By.
  4. Select the Bar Chart as the chart type.

Lost Revenue per Customer per Category

Now that you know how much you earned per customer per product category, you may want to know how much money you lost. To find out, you simply create a new metric (calculated measure) Lost Revenue per Customer and slice it with Product Category.

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.

  4. Name the metric Lost Revenue per Customer.
  5. Construct the following metric:
    SELECT AVG (SELECT Lost Revenue BY Customer ID)
    Do not forget to select Lost Revenue and Customer ID metrics from the element browser on the right.
  6. Click Add.
  7. Go to the Analytical Designer (click the Analyze tab).
  8. Drag the new Lost Revenue per Customer calculated measure from the Data Catalog to MEASURES.
  9. Drag Product Category to VIEW BY.
  10. Select the Bar Chart as the chart type.