11.12. Controls Filter Controls
Controls filter controls is an interesting concept that demonstrates how the active selection within a control can affect the available values in other controls on the page. This is because when you use a control to filter the report, it filters every component on the page, including other controls.
Hierarchy and Filtering
Imagine a scenario where you have controls for continents, countries, regions, and cities. There's a hierarchy to these dimensions, so users might expect that selecting a continent will filter the other controls to show only values related to that continent.
For example, if a viewer selects Europe, they would see a reduced list of countries, regions, and cities related to Europe. This is an expected outcome, as the viewer understands the hierarchy.
However, controls filter controls do not care about the hierarchy. If a viewer selects a city, such as London, the other controls will also be filtered based on this selection, showing only the continents, countries, and regions associated with London. This can lead to confusion for the viewer when they want to explore data for a different continent or country.
To resolve this issue, the viewer needs to either right-click on the report and reset, or reset the values on the control itself.
Adding Value Counts to Controls
If you're wondering how to add value counts (like the number of continents, countries, or regions) to your controls, here's a quick explanation:
- Create a scorecard for each value you want to display.
- In the Style tab of the scorecard, increase the left margin (for example, from 16 pixels to 96 pixels) to position the text.
- Modify the scorecard's appearance by creating rounded edges and adding a background color.
- For the number displayed on the scorecard, apply the corresponding dimension (such as continent, country, or region) with a "count distinct" metric. This will count the distinct number of items available for that dimension.