- 05 Jul 2022
- 1 Minute to read
- Updated on 05 Jul 2022
- 1 Minute to read
In this article, we will learn how to limit the availability of specified values within a filter using the Pre-filter available values configuration option.
Filter Configuration Options
The following configuration options are available for these filter types:
|Value||Numerical Range||Time Range||Time Column||Time Grain|
|Pre-filter available values||✔||✔|
|Sort filter values||✔||✔||✔||✔|
In the Parent-child Filter article we used the Values are dependent on other filters option to create a parent-child relationship between the Select Platform and Select Genre value filters, respectively.
Recall that, in the Select Platform filter, all available platform values were available as selectable options in the drop-down (e.g., 2600, 3DO, 3DS, etc.).
What if we wanted to only display PlayStation values (i.e., PS2, PS3, and PS4) in the Select Platform filter? This can easily be done via the Pre-filter available values setting, which simply limits the number of selectable values in a filter.
Let's dive in and see how it works!
Start by selecting the "Select Platform" filter we created earlier and, in the Filter Configuration panel, select Pre-filter available values. A Pre-Filter field appears.
Select the Pre-Filter field and a sub-menu appears featuring a pair of tabs: Simple and Custom SQL.
The Simple tab enables you to correlate a column with a defined value via operators (e.g., equals, not equals, <, >, etc.). The Custom SQL tab enables you to enter your own custom SQL code to specify pre-filtered values for a column.
In this example, we want to limit the options to just PS2, PS3, and PS4. To do this, select the column Platform, the operator IN (since there will be multiple options), and the values PS2, PS3, and PS4. If you wish to also filter by time range, just select the No filter button and configure accordingly.
When done, remember to select Save for the pre-filter and Save again for the filter as a whole!
The configuration should look as follows:
Navigating back to the dashboard, you can see that the Select Platform filter now only displays the three pre-filtered values:
Sort Filter Values
Single Value Range
Scoping a Filter