Adding Filters to User-defined Dashboards

On this Page
Docs Menu

The previous tutorials showed how to create a dashboard and edit a dashboard. This tutorial shows how to configure and add filters to your dashboards so that your users can restrict the data displayed in the dashboards.

Adding Dashboard Filters a User Can Change

Filters can be added to a dashboard so that users can narrow the dashboard’s results to the data they are interested in. Adding a filter consists of these major steps:

  1. Create the filter itself, which is what the user will interact with.
  2. Decide which dashboard tiles should “listen” to that filter. If you don’t actively do this, a tile will simply ignore the filter.

To get started, make sure the dashboard is in edit mode and then click Filters in the dashboard toolbar:

This will bring up the Add/Edit Dashboard Filters window:

Next, on the Add/Edit Dashboard Filters window:

  1. Click New Filter to create a new filter. Looker lists the new filter on the left hand side of the filters pop-up. You can drag and drop the filters to control the order in which they appear on the dashboard.
  2. Give your filter a name.
  3. Choose the type of filter you want to create. You are able to create a Date, String, Number or Field filter. The Date, String, and Number types let the user enter any value they like of that type. The Field” type lets you choose a specific LookML field from which Looker will create suggestions for the user.
  4. Add a default value if desired. This value will be suggested to the user when they load the dashboard, but they can change it if they like. You can choose a basic default value from the drop-down options, or create a more complex default value based on an advanced match, as explained here.
  5. Decide which tiles the filter should be applied to and turn them on. Then, choose the LookML field to which the value of the filter will be applied.
  6. In the Customize Filter tab, decide whether:

    • a filter should require a value before the dashboard can be run (as described in this section),
    • a user should be able to select only a single filter value or multiple filter values (as described in this section).
  7. In the Filters to Update tab, you can make different filters dependent on the selected filter, as described in the following section. To do so:

    1. Save your filter, as defined so far.
    2. Toggle the switch to ON next to the other filters you want to make dependent on this filter.
  8. Save your filter.

Setting Up Faceted Filters

Dashboard filters of the “field” type can be applied to other “field” filters. For example, you might have an “Airport State” filter and an “Airport Name” filter. One thing you may want to do is update the “Airport Name” filter based on the “Airport State” filter:

By doing so, only the airports that are within the chosen state will be suggested to the user:

Requiring a Filter Value

By default, filters do not require values. If a filter is not given a value, the data simply isn’t restricted by the filter field. For example, if you have a filter on a “State” field on a dashboard, if that filter was not given a value, the dashboard would return data for all states.

You can choose to require that a user enter a value in a filter before they can run the dashboard:

  1. Click on the filter in the Add/Edit Dashboard Filters window.
  2. Click on the Customize Filter tab.
  3. Set the Require a filter value to run this dashboard to OFF or ON.
  4. Click Save.

if Require a filter value to run this dashboard is ON, whenever a user tries to run the dashboard without entering a value in the required filter:

  • The dashboard Run button is grayed-out and disabled.
  • If a user hovers over the Run button, a message shows indicating that they must supply a value for the filter in order to run the dashboard.
  • There is a yellow warning icon next to the filter field.
  • If a user hovers over the warning icon, it displays a message that the filter requires a value.
  • The Clear Cache and Refresh options are disabled in both the dashboard gear menu and the individual tile menus.

Limiting the Number of Values

By default, a user can select multiple values for a dashboard filter. You can choose to limit users to a single filter value:

  1. Click on the filter in the Add/Edit Dashboard Filters window.
  2. Click on the Customize Filter tab.
  3. Set the Allow multiple filter values to OFF or ON.
  4. Click Save.

When Allow multiple filter values is ON, the user has the option to add additional values for a filter:

When Allow multiple filter values is OFF, there is no option to add a second value for the filter, and the filter’s default value can be either “is equal to”, “is on the day” (for dates), or “matches a user attribute”:

For location fields, the dashboard filter cannot be set to Allow multiple filter values OFF.

Conclusion

Now that you know how to add filters to your dashboards, go to the next tutorial to learn how to create and save Looks that you can use in tiles on multiple dashboards.

Still have questions?
Go to Discourse - or - Email Support
Top