Skip to Content

Metric filters

Apply a metric filter

Add a filter that viewers use to change one metric, and choose the column it filters.

Add a filter that viewers use to change one metric, and choose the column it filters.

Before you start

  • The metric is open in the builder and the preview has results. Create a metric

Steps

  1. Above the chart, select Add filter, then Metric Filters.

    Add filter menu open above the chart with Metric Filters highlighted above Switch X Axis, Switch Y Axis and Group By.
    Add filter is above the chart; Metric Filters is the first item.
  2. In Filter Name, enter a name, for example Region. This first step has no tabs. Until you fill the required fields, a note reads “Please complete all required fields to configure the filter.”

    Metric Filters dialog with Store state typed in the highlighted Filter Name field.
    Metric Filters opens with Filter Name at the top.
  3. In Option Type, choose Auto.

    Metric Filters dialog with the Option Type buttons highlighted and Auto picked.
    Option Type sets where the options come from.
  4. In Filter Variant, choose Single-Select, Multi-Select or Search.

    Metric Filters dialog with the Filter Variant buttons highlighted and Single-Select picked.
    Filter Variant is to the right of Option Type.
  5. In Dataset, pick the table. In Choose a column, pick the column, for example region.

    Metric Filters dialog with the Dataset field highlighted and set to dbn-demo_sales, and Choose a column set to store state.
    Pick the Dataset, then the column that holds the options.
  6. Select Next.

  7. Keep Apply On. In Dataset, pick the table to filter.

    Metric Filters dialog second step with Apply On picked and the Dataset field highlighted, set to dbn-demo_sales.
    The second step: Apply On, then the dataset to filter.
  8. In Choose a column from table, pick the column to filter, for example region.

    Metric Filters dialog second step with Choose a column from table highlighted and set to store state, and the Save button.
    Pick the column the filter narrows.
  9. Select Save.

The filter is on the metric. When a viewer picks a value, the metric shows only the matching rows. Select Back at any time to change the options.

Option types

Option TypeWhere the options come from
AutoThe distinct values of a column. Use Choose a unique label column to show other text for each value.
RangeA number range from a low value to a high value.
DateDates. In Date Type, choose Date Selection or Preset Date. For Date Selection, choose Single Date, Date Range or Time Range in Selection Type.
ManualValues you type. Choose string or number, enter each option value and an optional option label, and select Add Option.
CustomA SQL query you write. Use SQL for filter options

Filter Variant shows for text values. Search is only for Auto. Custom and Manual offer Single-Select and Multi-Select.

Advanced Options has more settings, such as Auto Select All Options and Allow Sorting. For Auto, turn on Show client scoped filter options and pick the client column to scope the options by client.

Where the filter applies

On the Apply On tab you choose what the selected value changes:

  • Apply On filters a column. To filter more than one column, select Add Column and choose how to combine the columns. Turn on Custom SQL to filter on an expression, for example LOWER("Category").
  • Variable Filter puts the value into a placeholder in your SQL. Use a metric filter as a SQL variable

Turn on App Filter to let your app set the value in the guest token. Metric App Filter

If something goes wrong

  • Option Type is greyed out. Enter a Filter Name first.
  • please enter a valid name. Enter a name that no other filter on this metric uses.
  • Two filters share a name. Rename one of them. Give each filter its own name.