Apply a Group Filter from a Custom Metric
This applies to: Visual Data Discovery
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.
Create the custom metric
-
Select the filter icon on the visual, filter snippet, or dashboard to access the appropriate filter sidebar.
To access the filter sidebar, select its filter icon () or select Settings from the menu () and then select on the sidebar menu.
To access the dashboard filter sidebar, select its filter icon (). The dashboard-level filter icon is available only when all the visuals are from the same data source.
The Filters sidebar appears showing any filters that have been applied.
Select Add Filter.
Select and select Add Custom Metric from the resulting menu. The Custom Metrics Editor appears.
In the Function Library, double-select AVG(field).
In Attributes & Metrics, select Sales.
Select Run to see a preview of the results.
Name your custom metric and select Save.
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 visual, filter snippet, or dashboard.
Filter your data by the aggregated field
-
Select the filter icon on the visual, filter snippet, or dashboard to access the appropriate filter sidebar.
To access the filter sidebar, select its filter icon () or select Settings from the menu () and then select on the sidebar menu.
To access the dashboard filter sidebar, select its filter icon (). The dashboard-level filter icon is available only when all the visuals are from the same data source.
The Filters sidebar appears showing any filters that have been applied.
Select Add Filter.
Ensure that the row-level filter for males in Los Angeles is applied.
Select Add Filter.
From the list of available attributes, select Zipcode.
Choose the zip codes you want to include in your results. For example, all the 900 zip codes or 90211, 90305, and 90701.
Select Apply.
Select Add Filter.
Select the Group tab.
Select your saved custom metric from the list of available custom metrics for use.
Select the Operator tab and then select the greater-than (>)operator.
In the value field, enter 100 and then select Apply. In the Filters sidebar , you can see all the filters you have applied thus far.
On the visual canvas, select Group and ensure Product Category is selected for an attribute.
To view the differences in average sales for products, simply filter on different income brackets. For example, apply a filter for incomes between $100 to $1000.
Comments
0 comments
Please sign in to leave a comment.