Skip to content
Snippets Groups Projects
Unverified Commit 3a7a69e5 authored by Phoomparin Mano's avatar Phoomparin Mano Committed by GitHub
Browse files

Merge branch 'release-x.51.x' into backport-000dfe1b

parents 2af60811 ce3285d4
No related branches found
No related tags found
No related merge requests found
Showing
with 90 additions and 43 deletions
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_Dark_Theme_Default.png

63.7 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_Dark_Theme_Default.png

63.6 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_Dark_Theme_Default.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_Dark_Theme_Default.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_Dark_Theme_Default.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_Dark_Theme_Default.png
  • 2-up
  • Swipe
  • Onion skin
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Number.png

67.8 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Number.png

67.8 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Number.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Number.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Number.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Number.png
  • 2-up
  • Swipe
  • Onion skin
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List.png

73.9 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List.png

73.9 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List.png
  • 2-up
  • Swipe
  • Onion skin
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Text_With_Value.png

68 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Text_With_Value.png

68 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Text_With_Value.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Text_With_Value.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Text_With_Value.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Text_With_Value.png
  • 2-up
  • Swipe
  • Onion skin
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Range.png

79.6 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Range.png

79.6 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Range.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Range.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Range.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Range.png
  • 2-up
  • Swipe
  • Onion skin
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Relative.png

74.6 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Relative.png

74.6 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Relative.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Relative.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Relative.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Relative.png
  • 2-up
  • Swipe
  • Onion skin
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Single.png

82.5 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Single.png

82.5 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Single.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Single.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Single.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Single.png
  • 2-up
  • Swipe
  • Onion skin
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List.png

73.4 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List.png

73.4 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -222,7 +222,9 @@
(defn query-jdbc-db
"Execute a SQL query against a JDBC database. Useful for testing SQL syntax locally.
(query-jdbc-db :oracle SELECT to_date('1970-01-01', 'YYYY-MM-DD') FROM dual\")
(query-jdbc-db :oracle \"SELECT to_date('1970-01-01', 'YYYY-MM-DD') FROM dual\")
(query-jdbc-db :h2 \"SELECT name FROM people WHERE name LIKE '%Ken%'\")
`sql-args` can be either a SQL string or a tuple with a SQL string followed by any prepared statement args. By
default this method uses the same methods to set prepared statement args and read columns from results as used by
......@@ -279,7 +281,11 @@
;; use it with raw SQL
(t2/query (t2/select-one Database :engine :postgres, :name \"test-data\")
\"SELECT * FROM venues;\")"
\"SELECT * FROM venues;\")
;; use it with the Sample Database
(t2/query (t2/select-one Database :engine :h2, :name \"Sample Database\")
\"SELECT * FROM people LIMIT 1;\")"
[database f]
(t2.connection/do-with-connection (sql-jdbc.conn/db->pooled-connection-spec database) f))
......
......@@ -152,6 +152,7 @@ Metabase's reference documentation.
- [SAML with Google](./people-and-groups/saml-google.md)
- [SAML with Keycloak](./people-and-groups/saml-keycloak.md)
- [SAML with Okta](./people-and-groups/saml-okta.md)
- [User provisioning with SCIM](./people-and-groups/user-provisioning.md)
### Permissions
......
......@@ -4,42 +4,46 @@ redirect_from:
- /docs/latest/users-guide/08-dashboard-filters
---
# Dashboard filters
# Dashboard filters and parameters
![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, 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
![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-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
![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.
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.
......
docs/dashboards/images/add-filter.png

188 KiB | W: | H:

docs/dashboards/images/add-filter.png

193 KiB | W: | H:

docs/dashboards/images/add-filter.png
docs/dashboards/images/add-filter.png
docs/dashboards/images/add-filter.png
docs/dashboards/images/add-filter.png
  • 2-up
  • Swipe
  • Onion skin
docs/dashboards/images/filters.png

70.6 KiB | W: | H:

docs/dashboards/images/filters.png

133 KiB | W: | H:

docs/dashboards/images/filters.png
docs/dashboards/images/filters.png
docs/dashboards/images/filters.png
docs/dashboards/images/filters.png
  • 2-up
  • Swipe
  • Onion skin
docs/dashboards/images/time-grouping.png

139 KiB

......@@ -172,6 +172,12 @@ mysql:
command: ["--default-authentication-plugin=mysql_native_password"]
```
## Limitations with Vitess-based databases
When querying Vitess databases, you should add a `LIMIT` clause inside each subquery.
The reason: typically, Metabase applies limits (e.g., 2000 or 10000 rows) to the final query results. But due to a known bug in Vitess, Vitess might apply these limits to subqueries, which can lead to unexpected results. The workaround is to add limits to each of your subqueries.
## Further reading
- [MariaDB](./mariadb.md)
......
......@@ -8,19 +8,23 @@ redirect_from:
To add a database connection, click on the **gear** icon in the top right, and navigate to **Admin settings** > **Databases** > **Add a database**.
## Settings
You can edit these settings at any time. Just remember to save your changes.
### Display name
## Display name
The display name for the database in the Metabase interface.
### Account name
## Account or hostname
You have the option of using an account name or hostname. Your hostname is your database's IP address or its domain name (e.g., database.example.com).
If your URL includes your database's region, you can connect using an account name, otherwise connect using a hostname.
### AWS
Enter your Snowflake [Account Identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html).
Connect with an account name.
**If you're on AWS**, Enter your Account identifier with the region that your Snowflake cluster is running on. E.g., `xxxxxxxxx.us-east-3.aws`. For example, if you're running Snowflake on AWS and your account URL is `https://az12345.ca-central-1.snowflakecomputing.com`:
Enter your Account identifier with the region that your Snowflake cluster is running on. E.g., `xxxxxxxxx.us-east-3.aws`. For example, if you're running Snowflake on AWS and your account URL is `https://az12345.ca-central-1.snowflakecomputing.com`:
- `<account_identifier>`: `az12345.ca-central-1`.
- `<cloud_platform>`: `aws`.
......@@ -29,35 +33,41 @@ You'd enter `az12345.ca-central-1.aws` as the account name in Metabase.
Not all regions require the cloud platform identifier. If you're in `us-west-2`, you would enter `az12345` as the account name. For the requirements per region, see [the official Snowflake's documentation](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#non-vps-account-locator-formats-by-cloud-platform-and-region).
**If you're on app.snowflake.com**, you can get your account name by going to Admin > Accounts. The Account name will be under Accounts. For the account you want to use, click on the three dot menu and select "Manage URLs". The "Current URL" contains your account identifier. E.g., `https://<account-identifier>.snowflakecomputing.com`.
### app.snowflake.com
Connect with a host name.
You can get your host name by going to Admin > Accounts. The Account name will be under Accounts. Click on the account you want to use, and click on the link icon to copy the host URL: that's your host name. In the image below, Metabot is discreetly covering sensitive info. The "Copy account URL" link on the right is what you're looking for:
![Snowflake copy account URL](../images/snowflake-copy-account-url.png)
Learn more about [Account Identifiers in Snowflake](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html).
Learn more about [Account Identifiers in Snowflake](https://docs.snowflake.com/en/user-guide/admin-account-identifier).
### Username
## Username
The database username for the account that you want to use to connect to your database. You can set up multiple connections to the same database using different user accounts to connect to the same database, each with different sets of [privileges](../users-roles-privileges.md).
On your app.snowflake.com account page, you can find Users and roles under Admin > Users & Roles.
### Password
## Password
The password for the username that you use to connect to the database.
### RSA private key (PEM)
## RSA private key (PEM)
Not required. You have the option of using a **Local file path** or an **Uploaded file path**. If you're on Metabase Cloud, you'll need to select **Uploaded file path** and upload your certificate.
### Warehouse
## Warehouse
Snowflake warehouse. If the user lacks a default warehouse, you'll need to enter the warehouse to connect to.
On app.snowflake.com, you can find warehouses under Admin > Warehouses.
### Database name (case sensitive)
## Database name (case sensitive)
The name of the database you want to connect to in Snowflake. On app.snowflake.com you can find databases under Data > Databases.
### Schemas (optional)
## Schemas (optional)
You can specify which schemas you want to sync and scan. If no schema is passed, then all schema available to that user and role will be listed as folders in Metabase.
......@@ -82,7 +92,7 @@ Let's say you have three schemas: FOO, BAR, and BAZ.
Note that only the `*` wildcard is supported; you can't use other special characters or regexes.
### Role (optional)
## Role (optional)
Specify a role to override the database user's default role. For example, if the database user `METABASE` has the roles:
......@@ -95,28 +105,28 @@ You can enter `ANALYTICS` in the Role field to ensure that the `METABASE` user c
See our [guide to SSH tunneling](../ssh-tunnel.md).
### Additional JDBC connection string options
## Additional JDBC connection string options
Some databases allow you to append options to the connection string that Metabase uses to connect to your database.
### Re-run queries for simple explorations
## Re-run queries for simple explorations
Turn this option **OFF** if people want to click **Run** (the play button) before applying any [Summarize](../../questions/query-builder/introduction.md#grouping-your-metrics) or filter selections.
By default, Metabase will execute a query as soon as you choose an grouping option from the **Summarize** menu or a filter condition from the [drill-through menu](https://www.metabase.com/learn/questions/drill-through). If your database is slow, you may want to disable re-running to avoid loading data on each click.
### Choose when Metabase syncs and scans
## Choose when Metabase syncs and scans
Turn this option **ON** to manage the queries that Metabase uses to stay up to date with your database. For more information, see [Syncing and scanning databases](../sync-scan.md).
#### Database syncing
### Database syncing
If you've selected **Choose when syncs and scans happen** > **ON**, you'll be able to set:
- The frequency of the [sync](../sync-scan.md#how-database-syncs-work): hourly (default) or daily.
- The time to run the sync, in the timezone of the server where your Metabase app is running.
#### Scanning for filter values
### Scanning for filter values
Metabase can scan the values present in each field in this database to enable checkbox filters in dashboards and questions. This can be a somewhat resource-intensive process, particularly if you have a very large database.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment