diff --git a/docs/dashboards/filters.md b/docs/dashboards/filters.md index ce67081daa29f453c26554fb81c58af0951df42f..b9464de48bfa5fc66798eef036b34badc4671994 100644 --- a/docs/dashboards/filters.md +++ b/docs/dashboards/filters.md @@ -4,42 +4,46 @@ redirect_from: - /docs/latest/users-guide/08-dashboard-filters --- -# Dashboard filters +# Dashboard filters and parameters  Have you ever found yourself in a situation where it seems like you need to create nearly identical copies of the same dashboard, with just one different variable? Maybe you have an Earnings dashboard, but you want to see the data for each city your business is in, or maybe you have a KPI dashboard that you want to see broken out by month. -Instead of creating duplicate dashboards, you can add filter widgets to let people change variables for cards on a dashboard. +Instead of creating duplicate dashboards, you can add filter or parameter widgets to let people change variables for cards on a dashboard. -## Adding a new filter +## Adding a filter or parameter  - Click the **pencil icon** to enter dashboard editing mode. - Click the **filter icon** that appears in the top-right to add a filter. -- Select a [filter type](#filter-types). -- [Connect your filter](#connecting-a-filter-to-dashboard-cards) to one or more dashboard cards on any or all tabs. -- [Configure your filter](#editing-a-filter). +- Select a [filter type](#filter-and-parameter-types) +- [Connect your filter or parameter widget to dashboard cards](#connecting-a-filter-or-parameter-widget-to-dashboard-cards) to one or more dashboard cards on any or all tabs. +- [Configure your filter](#editing-a-filter) - **Save** your changes. Metabase will display the filter only if the filter is connected to a card on the current dashboard tab. -## Filter types +## Filter and parameter types -You can choose from a number of filter types: +The type of filter or parameter widget you choose will determine how the widget works, as well as which fields you’ll be able to filter your cards by. -- [Time](#time-filters) +### Filter widgets + +- [Date picker](#date-picker-filters) - [Location](#location-filters) - [ID](#id-filter) - [Number](#number-filter) -- [Text or categories](#text-or-category-filter) +- [Text or category](#text-or-category-filter) + +### Parameter widgets -The type of filter you choose will determine how the filter works, as well as which fields you’ll be able to filter your cards by. +- [Time grouping](#time-grouping-parameter) -### Time filters +## Date picker filters -When picking a Time filter, Metabase will prompt you to pick a specific type of filter widget: +When picking a Time filter, Metabase will prompt you to pick a specific type of date picker widget: - Month and Year - Quarter and Year @@ -50,7 +54,25 @@ When picking a Time filter, Metabase will prompt you to pick a specific type of Single Date and Date Range will provide a calendar widget, while the other options all provide slightly different dropdown interfaces for picking values. To get a widget that's just like the time filter in the query builder, choose All options. -### Location filters +## Time grouping parameter + + + +You can add a time grouping widget to a dashboard to change how charts are grouped by time. For example, you may want to look at the time series charts grouped by month by default, but give people the option to view the results by other groupings: by week, by quarter, and so on. + +This widget doesn't filter data in the charts; the widget just changes the time granularity for any cards that have a datetime field connected to the widget. + +You can group by: + +- Minute (or minute of hour) +- Hour (or hour of day) +- Day (or day of week, month, or year) +- Week (or week of year) +- Month (or month of year) +- Quarter (or quarter of year) +- Year + +## Location filters There are four types of Location filters to choose from: @@ -59,11 +81,11 @@ There are four types of Location filters to choose from: - ZIP or Postal Code - Country -### ID filter +## ID filter The ID filter provides a simple input box where you can type the ID of a user, order, etc. -### Number filter +## Number filter You can choose from: @@ -73,7 +95,7 @@ You can choose from: - Greater than or equal to - Less than or equal to -### Text or category filter +## Text or category filter A flexible filter type that will let you create either a dropdown menu or an input box to filter on any category field in your cards. Options include: @@ -84,9 +106,11 @@ A flexible filter type that will let you create either a dropdown menu or an inp - **Starts with**. Match values that begin with the entered text. - **Ends with**. Match values that end with the entered text. -## Connecting a filter to dashboard cards +## Connecting a filter or parameter widget to dashboard cards + +Dashboard widgets apply across all [dashboard tabs](./introduction.md#dashboard-tabs), though they'll only be displayed when a tab has cards connected to the widget. -Dashboard filters apply across all [dashboard tabs](./introduction.md#dashboard-tabs), though for each filter you add, you'll need to tell Metabase which column the filter should update for each card. +For each widget that you add, you'll need to tell Metabase which column the filter should update for each card. Click on a card's dropdown menu to select the field that you want the widget to filter on. @@ -96,7 +120,7 @@ Here we've wired up a Text filter to the "Event types" card, telling Metabase th ## Auto-connecting filters to cards -If there are other cards that also have the field you select, Metabase will automatically connect the filter to those cards too (including to relevant cards on other tabs). If you later add a card with the selected field, Metabase will also try to connect that filter to the new card. +If there are other cards that also have the field you select, Metabase will offer to automatically connect the filter to those cards too (including to relevant cards on other tabs). If you later add a card with the selected field, Metabase will also try to connect that filter to the new card. To undo this auto-connecting of cards, click on the toast that pops up when Metabase auto-connects the cards, or manually disconnect the cards by clicking on the "X" next to the connected field. @@ -108,7 +132,7 @@ If you're trying to connect a filter to a card with a native/SQL questions, you' You can even wire up filters to text cards, but only if [the text card includes a variable](./introduction.md#including-variables-in-text-cards). -## Requiring a filter +## Requiring a filter or parameter You can tell Metabase to require a filter so that people _must_ filter the dashboard by a certain column on a card. If you require a filter, you'll also need to supply a default value for that filter. diff --git a/docs/dashboards/images/add-filter.png b/docs/dashboards/images/add-filter.png index e4d9cd39b737a203bdcdf50d4ba859803dcb0cbc..460ab1466a5a2b236abb29e234bc9fd50d77f36b 100644 Binary files a/docs/dashboards/images/add-filter.png and b/docs/dashboards/images/add-filter.png differ diff --git a/docs/dashboards/images/filters.png b/docs/dashboards/images/filters.png index 60540a9caa1ebcc50881429d963a9ead679eb84e..7045deead21a8fa227044046442b2dee5435ae2a 100644 Binary files a/docs/dashboards/images/filters.png and b/docs/dashboards/images/filters.png differ diff --git a/docs/dashboards/images/time-grouping.png b/docs/dashboards/images/time-grouping.png new file mode 100644 index 0000000000000000000000000000000000000000..4de5638ef02aeb5101a30100fd0dda1954644a25 Binary files /dev/null and b/docs/dashboards/images/time-grouping.png differ