When working with multiple filter types, row-level filters are applied first to a visual, keyset filters are applied next, and group filters are applied last on the aggregated result set.
Apply a Group Filter from a Metric
Suppose you want to find product sales greater than $200,000 for the last quarter within the greater Los Angeles area. You might create a group filter using the following steps. This example requires that you have already applied a row-level filter for the city of Los Angeles. Group filters can only be applied from a specific visual or filter snippet. They cannot be applied to a dashboard. Create the group filter-
Select the filter icon (
) or select Settings from the menu (
) and then select
on the sidebar menu.
The Filters sidebar appears showing any filters that have been applied.
- Select Add Filter. A work area opens for applying Row, Group, and Saved filters.
- Select the Group tab and select the numeric field Sales on the tab. The Range tab appears in the Filters sidebar. By default, the Aggregation function is set to Sum. You can select other values from the drop-down list.
- Select the Greater Than operator in the Operator selection box. This allows you to input a threshold value, rather than a value range.
- Specify a threshold value of 200000 in the Value box.
- Select Apply.
- After the visual updates, select Group and then select Product Category. This displays all sales of products totally over $200,000.
- Remember to save your filter.
Apply 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. 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.
- To access the filter sidebar, select its filter icon (
- Select Add Filter. A work area opens for applying Row, Group, and Saved filters.
-
Select an add icon
and select Add Custom Metric from the resulting menu. The Custom Metrics Editor appears.
- In the Function Library, double-select AVG(field).
- In Fields, select Sales.
- Select Run to see a preview of the results.
- Name your custom metric and select Save.
- Close the Custom Metrics Editor.
-
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.
- To access the filter sidebar, select its filter icon (
- 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.