Skip to content

[auto-build] docs-filters-in-headings-and-dashcards -> master #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
70 changes: 47 additions & 23 deletions _docs/master/dashboards/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@ redirect_from:

![Dashboard Filters](./images/filters.png)

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 to show different cuts of the same data, you can add filter or parameter 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 filter or parameter
## Adding a filter or parameter widget to a dashboard, heading, or card

![Add a Filter](./images/add-filter.png)

- 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-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.
1. Click the **pencil icon** to enter dashboard editing mode.
2. You can add a filter or parameter widget to:

- **The whole dashboard**. Metabase will only display dashboard-level widgets if they're connected to a card on the current tab.
- **Heading cards**. Not text cards, only [heading cards](./introduction#adding-headings-or-descriptions-with-text-cards). Can only be connected to cards on the current tab.
- **Question cards**. Can only be connected to cards on the current tab.

Go to where you want to add a filter and click the **filter icon**.
3. Select a [filter type](#filter-and-parameter-types).
4. [Connect your filter or parameter widget to dashboard cards](#connecting-a-filter-or-parameter-widget-to-dashboard-cards) to one or more dashboard cards. Only dashboard-level widgets can be connected to cards on multiple tabs.
5. [Configure your filter](#editing-a-filter)
6. **Save** your changes.

Metabase will display the filter only if the filter is connected to a card on the current dashboard tab.

Expand All @@ -39,7 +43,7 @@ The type of filter or parameter widget you choose determines how the widget work

### Filter widgets

**Filters** determine what data to show. For example, a date filter might show only data from the last 30 days, or a category filter might show only specific product categories.
**Filters** determine _what_ data to show. For example, a date filter might show only data from the last 30 days, or a category filter might show only specific product categories.

- [Date picker](#date-picker-filters)
- [Location](#location-filters)
Expand All @@ -50,13 +54,13 @@ The type of filter or parameter widget you choose determines how the widget work

### Parameter widgets

**Parameters** determine how to show the data. The time grouping parameter, for example, changes the granularity of time-based visualizations (like showing data by month instead of by day) without removing any data points.
**Parameters** determine _how_ to show the data. The time grouping parameter, for example, changes the granularity of time-based visualizations (like showing data by month instead of by day) without removing any data points.

- [Time grouping](#time-grouping-parameter)

## Date picker filters

When picking a Time filter, Metabase will prompt you to pick a specific type of date picker widget:
When picking a Date picker filter, Metabase will prompt you to pick an operator:

- Month and Year
- Quarter and Year
Expand All @@ -65,19 +69,17 @@ When picking a Time filter, Metabase will prompt you to pick a specific type of
- Relative Date
- All Options

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.
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 date picker in the query builder, choose All options.

## Time grouping parameter

![Time grouping](./images/time-grouping.png)

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.

> Time grouping parameter widget can only be connected to questions built with the [graphical query builder](../questions/query-builder/editor).
You can add a time grouping widget to a dashboard to change how charts are grouped by time. This widget won't filter the data; it'll change how Metabase displays the data. 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 same 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:
Grouping options include:

- Minute (or minute of hour)
- Hour (or hour of day)
Expand All @@ -87,6 +89,8 @@ You can group by:
- Quarter (or quarter of year)
- Year

To connect a time grouping widget to a SQL question, you'll need to insert time grouping parameters in your code. See [time grouping parameters](../questions/native-editor/time-grouping-parameters).

## Location filters

There are four types of Location filters to choose from:
Expand All @@ -96,10 +100,21 @@ There are four types of Location filters to choose from:
- ZIP or Postal Code
- Country

Additionally, you can select an operator for the location filter:

- **Is**. Select one or more values from a list or search box. Use **Is** when you just want to plug a value into a variable. For multiple values, the card must be either a question built using the query builder, or a native/SQL question using a [field filter](../questions/native-editor/sql-parameters#field-filter-variables).
- **Is not**. Exclude one or more specific values.
- **Contains**. Match values that contain the entered text.
- **Does not contain**. Filter out values that contain the entered text.
- **Starts with**. Match values that begin with the entered text.
- **Ends with**. Match values that end with the entered text.

## ID filter

The ID filter provides a simple input box where you can type the ID of a user, order, etc.

You can give people the option to pick one value or multiple values.

## Number filter

You can choose from:
Expand All @@ -114,21 +129,25 @@ You can choose from:

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:

- **Is**. Select one or more values from a list or search box. Use **Is** when you just want to plug a value into a variable. For multiple values, the card must be either a question built using the query builder, or a native/SQL question using a [field filter](../questions/native-editor/sql-parameters#the-field-filter-variable-type).
- **Is**. Select one or more values from a list or search box. Use **Is** when you just want to plug a value into a variable. For multiple values, the card must be either a question built using the query builder, or a native/SQL question using a [field filter](../questions/native-editor/sql-parameters#field-filter-variables).
- **Is not**. Exclude one or more specific values.
- **Contains**. Match values that contain the entered text.
- **Does not contain**. Filter out values that contain the entered text.
- **Starts with**. Match values that begin with the entered text.
- **Ends with**. Match values that end with the entered text.

You can also select how people should filter on this column:

- Dropdown list
- Search box
- Input box

## Boolean filter

A boolean filter allows people to filter data based on true/false values.

## Connecting a filter or parameter widget to dashboard cards

Dashboard widgets apply across all [dashboard tabs](./introduction#dashboard-tabs), though they'll only be displayed when a tab has cards connected to the widget.

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.
Expand All @@ -137,6 +156,11 @@ Here we've wired up a Text filter to the "Event types" card, telling Metabase th

![Wiring up a dashboard filter to a card](./images/wiring-cards.png)

Which cards you can connect a filter or parameter widget to depends on:

- Whether the question card has the relevant field.
- Where the widget is located: on the dashboard, heading card, or question card. Only dashboard widgets can be connected to cards across all [dashboard tabs](./introduction#dashboard-tabs). Widgets on heading and question cards are restricted to the cards on their respective tabs.

## Auto-connecting filters to cards

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.
Expand All @@ -145,9 +169,9 @@ To undo this auto-connecting of cards, click on the toast that pops up when Meta

## Filtering dashboards with native/SQL questions

If you're trying to connect a filter to a card with a native/SQL questions, you'll need to [add a variable or field filter to your query](../questions/native-editor/sql-parameters). For an in-depth article, check out [Adding filters to dashboards with SQL questions](/learn/metabase-basics/querying-and-dashboards/sql-in-metabase/filters).
For filters, you'll need to [add a variable or field filter to your query](../questions/native-editor/sql-parameters).

You can't connect a time grouping parameter widget to a card with a SQL question.
For parameters, check out [Time grouping parameters](../questions/native-editor/time-grouping-parameters).

## Wiring up dashboard filters to text cards

Expand Down
2 changes: 1 addition & 1 deletion _docs/master/dashboards/linked-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Metabase uses database column metadata to populate values for linked filters, wh

- You can't create linked filters on custom columns.

- Native/SQL questions must have a [field filter](../questions/native-editor/sql-parameters#the-field-filter-variable-type) variable in order to be linked. Basic SQL variables aren't connected to database columns, so they won't work for linked filters.
- Native/SQL questions must have a [field filter](../questions/native-editor/sql-parameters#field-filter-variables) variable in order to be linked. Basic SQL variables aren't connected to database columns, so they won't work for linked filters.

- You can't link filters that use "Custom List" or "From another model or question" as their value's source.

Expand Down
2 changes: 1 addition & 1 deletion _docs/master/data-modeling/field-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ When you [X-ray](../exploration-and-organization/x-rays) a table, model, or enti

### Field Filters

Knowing what field types are and how they work is helpful when using [field filters](/learn/metabase-basics/querying-and-dashboards/sql-in-metabase/field-filters), as you can only create field filters for [certain field types](../questions/native-editor/sql-parameters#field-filter-compatible-types).
Knowing what field types are and how they work is helpful when using [field filters](/learn/metabase-basics/querying-and-dashboards/sql-in-metabase/field-filters), as you can only create field filters for [certain field types](../questions/native-editor/sql-parameters#field-filters-are-only-compatible-with-certain-types).

### JSON unfolding

Expand Down
2 changes: 1 addition & 1 deletion _docs/master/developers-guide/community-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Anyone can build a community driver. These are the currently known third-party d
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| [CSV](https://github.com/Markenson/csv-metabase-driver) | ![GitHub stars](https://img.shields.io/github/stars/Markenson/csv-metabase-driver) | ![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/Markenson/csv-metabase-driver) |
| [Databend](https://github.com/databendcloud/metabase-databend-driver) | ![GitHub stars](https://img.shields.io/github/stars/databendcloud/metabase-databend-driver) | ![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/databendcloud/metabase-databend-driver) |
| [DB2](https://github.com/damienchambe/metabase-db2-driver) | ![GitHub stars](https://img.shields.io/github/stars/damienchambe/metabase-db2-driver) | ![Github (Pre-)Release Date](https://img.shields.io/github/release-date-pre/damienchambe/metabase-db2-driver) |
| [DB2](https://github.com/damienchambe/metabase-db2-driver) | ![GitHub stars](https://img.shields.io/github/stars/damienchambe/metabase-db2-driver) | ![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/damienchambe/metabase-db2-driver) |
| [Dremio](https://github.com/Baoqi/metabase-dremio-driver) | ![GitHub stars](https://img.shields.io/github/stars/Baoqi/metabase-dremio-driver) | ![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/Baoqi/metabase-dremio-driver) |
| [DuckDB](https://github.com/MotherDuck-Open-Source/metabase_duckdb_driver) | ![GitHub stars](https://img.shields.io/github/stars/MotherDuck-Open-Source/metabase_duckdb_driver) | ![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/MotherDuck-Open-Source/metabase_duckdb_driver) |
| [Firebolt](https://github.com/firebolt-db/metabase-firebolt-driver) | ![GitHub stars](https://img.shields.io/github/stars/firebolt-db/metabase-firebolt-driver) | ![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/firebolt-db/metabase-firebolt-driver) |
Expand Down
2 changes: 2 additions & 0 deletions _docs/master/developers-guide/devenv.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ yarn dev

This runs both the [frontend](#frontend) and [backend](#backend). Alternatively, you can run them separately in two terminal sessions below.

To use any other database beside the default ones please take a look at [Building Drivers](#building-drivers) further down in this document.

### Frontend

Metabase depends on third-party libraries to run, so you'll need to keep those up to date. The Clojure CLI will automatically fetch the dependencies when needed. With JavaScript dependencies, however, you'll need to kick off the installation process manually.
Expand Down
2 changes: 1 addition & 1 deletion _docs/master/developers-guide/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function getFoo(a, b, c) {
}
```

- Be conservative with what comments you add to the codebase. Comments shouldn't be used as reminders or as todos--record those by creating a new issue in Github. Ideally, code should be written in such a way that it explains itself clearly. When it does not, you should first try rewriting the code. If for whatever reason you are unable to write something clearly, add a comment to explain the "why".
- Be conservative with what comments you add to the codebase. Comments shouldn't be used as reminders or as todos--record those by creating a new issue in GitHub. Ideally, code should be written in such a way that it explains itself clearly. When it does not, you should first try rewriting the code. If for whatever reason you are unable to write something clearly, add a comment to explain the "why".

```javascript

Expand Down
2 changes: 1 addition & 1 deletion _docs/master/developers-guide/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ E.g.,

## Further reading

- [Metabase releases on Github](https://github.com/metabase/metabase/releases)
- [Metabase releases on GitHub](https://github.com/metabase/metabase/releases)
- [Metabase release blog posts](/releases)
Loading