2. Saved filters

Create filtersReusable controls that slice dashboards.

A saved filter is a reusable control, such as a drop-down or a slider, that you define once and attach to datasets. When a reader changes the control, the dataset query runs again with the new value and every chart on that dataset redraws. The same filter can appear on visualizations and on dashboards.

Choose the right filter type#

Pick the type that matches how readers think about the value.

Type Control Use it to
Single select List Drop-down, one value Choose one region
Multi select List Drop-down, many values Choose several regions
Range From and To boxes Keep orders between two numbers or dates
Single Value One input Set a threshold
One-way slider Slider with one handle Set a minimum price
Two-way slider Slider with two handles Pick a price band
Toggle Switch Include or exclude returns

You create filters in Designer > Filters. A filter only changes a chart once a dataset query uses it (see "Make a filter change a chart").

Open the Filters list#

Open Designer and choose Filters in the left rail.

The Filters list with Filter Name, Display Name and Filter Type.
The Filters list with Filter Name, Display Name and Filter Type.

The controls match the visualizations list: Search Filters, Filter Type, Created By, Created On and New Filter. Columns are Filter Name (a link that opens the editor), Display Name, Filter Type, Last Updated By, Last Updated On and Actions (Rename, Delete). With no filters you see "No filters to show".

Create a filter#

Outcome: a named filter, ready to configure.

  1. Choose New Filter.
  2. In Enter Name type a name that follows the naming rule from the introduction. Use what the filter means, for example region.
  3. Optionally fill Display Name (optional), for example Region. Dashboards and datasets show the display name instead of the name.
  4. Choose Add. The filter is created empty. Open it to configure it.
The Add Filter dialog.
The Add Filter dialog.

Tip

Name filters for what they mean and set a Display Name. Readers see the display name.

Configure a filter#

  1. Choose the filter's name in the list to open its editor.
  2. Under TYPE AND SOURCE, choose the Type and the Source.
  3. Fill the CONFIGURATION section (it depends on the source and type, and is hidden for Toggle).
  4. Choose Save. The toast says Filter updated.
The editor for a dataset-sourced Multi select List filter.
The editor for a dataset-sourced Multi select List filter.

The Source is either:

  • Custom: you type the values yourself.
  • Datasets: Groundzero runs a dataset and uses one of its columns to fill the options. This is available for Single select, Multi select, One-way slider and Two-way slider.

Fields for a custom source#

  • Choose a Data Type: Number or Plain text for lists; Number or Date for Range; Number or Date Time for sliders.
  • Single and Multi select: add rows with Value and Display Value and the + button. Edit Values lets you change or delete rows. Pick the default selection.
  • Range: From and To. Date ranges add Choose Date Formats (and Fiscal Month for quarter formats).
  • Single Value: Value.
  • Sliders: Start, End, Step Type, Steps, Date Format, Fiscal Month.
  • Toggle: a checkbox for the default state.

Fields for a datasets source#

  • Choose a Datasets entry and a Columns entry. Range and slider types only offer number and date columns.
  • Use the Display values editor to map raw values to friendly text.

If Save is refused#

Message What to do
Please enter any value on the values thing. Add at least one value or display value.
Default value should be chosen for single select filter before saving Pick the default item.
At least one value should be chosen for multi select filter before saving Pick at least one item.
Please enter start value and end value both to save the filter. Fill both ends of a slider.
Please enter start date and end date both to save the filter. Fill both dates.
Please enter valid from and to values. Fix a malformed range.
From value should be less than or equal to To value. Swap the values.
Start date should be less than end date. Fix the dates.
Please select a date format before saving the filter. Choose a format.
End cannot be lesser than start Fix the slider ends.
Both Display Value and Value are required. Fill both fields before adding a row.
This value already exists. Remove the duplicate.
Value must be a valid number. Enter digits only for a numeric filter.

If the save fails you see "An error occurred while updating the filter.". If the filter cannot be opened you see "Filter not found. Please try refreshing the page."

Make a filter change a chart#

A filter takes effect on a dataset when the dataset's query contains the filter's placeholder, a short tag in double curly braces that Groundzero replaces with the reader's choice before the query runs.

  1. Open the dataset (Build and Run guide) and attach the filter in the Dataset editor. The editor lists the dataset's filters.
  2. Hover the filter in that list and choose the copy button. The toast says copied to clipboard {{name.value}}.
  3. Paste the placeholder into the query where the value belongs, and save the dataset.
Filter type Placeholder
Single select List, Single Value, Multi select List, Toggle {{name.value}}
Range and sliders {{name.fromValue}} and {{name.toValue}}

Groundzero replaces the placeholder with the reader's choice before it runs the query:

Control Text that replaces the placeholder
Single select ('Apparel')
Multi select ('A','B') (numbers are not quoted)
Nothing selected ('')
Range or slider numbers The bare numbers
Dates Formatted with the chosen date format
Toggle (True) or (False)

How to check it worked: open a visualization on that dataset and change the filter. The chart redraws.

Note

A filter does nothing until a query contains its placeholder. If a filter seems to have no effect, check the query first.

Use filters on a chart#

A visualization shows the filters attached to its dataset in the Filters pane on the left, one control per filter. Names longer than 20 characters are shortened. Hover to see the full name. Filters marked hidden in the dataset still change the query but are not drawn.

Changing a value re-runs the dataset and redraws the chart. A filter whose options come from a dataset query that uses other filters narrows its options when those filters change. For example, choosing a country can shorten a city list. This happens on its own.

The values a reader chooses are not saved with the visualization. Only the defaults saved in the filter apply when the chart opens.

  • Chapter 1, the visualization editor where filters appear.
  • Chapter 3, the dashboard filter bar.