Applying a Group Filter from a Custom Metric

Suppose you want to find product purchases made by males within certain areas of Los Angeles, while also comparing their income levels. Specifically, you are interested in men whose sales average more than $100,000. You might create a filter using the following steps. This example requires that you have already applied a row-level filter for the city of Los Angeles.

Since you do not have a custom metric created yet for average sales, one needs to be created.

To create the custom metric:

  1. Click the filter icon () on a chart.
  2. Click on the Filter panel (sidebar).
  3. Click and select Add Custom Metric from the resulting menu. The Custom Metrics Editor appears.
  4. In the Function Library, double-click AVG(field).
  5. In Attributes & Metrics, select Sales.
  6. Select Run Custom Metric to see a preview of the results.
  7. Name your custom metric and select Save.
  8. Close the Custom Metrics Editor.

Now that you have created and successfully saved the custom metric you want to use, you can apply it to the chart or dashboard.

To filter your data by the aggregated field:

  1. Click in the upper left of the chart or dashboard. The Filters sidebar appears.
  2. Ensure that the row-level filter for males in Los Angeles is applied.
  3. Click .
  4. From the list of available attributes, select Zipcode.
  5. Choose the zip codes you want to include in your results. For example, all of the 900 zip codes or 90211, 90305, and 90701.
  6. Select Apply.
  7. Click .
  8. Select the Group tab.
  9. Select your saved custom metric from the list of available custom metrics for use.
  10. Select the Operator tab and then click the greater-than (>)operator.
  11. In the value field, enter 100000 and then click Apply. In the Filters sidebar , you can see all the filters you have applied thus far.
  12. On the chart canvas, select Group and ensure Product Category is selected for an attribute.
  13. To view the differences in average sales for products, simply filter on different income brackets. For example, apply a filter for incomes between $50000 to $75000.