docs/versioned_docs/version-6.0.0/using-superset/creating-your-first-dashboard.mdx
import useBaseUrl from "@docusaurus/useBaseUrl";
This section is focused on documentation for end-users who will be using Superset for the data analysis and exploration workflow (data analysts, business analysts, data scientists, etc).
:::tip In addition to this site, Preset.io maintains an updated set of end-user documentation at docs.preset.io. :::
This tutorial targets someone who wants to create charts and dashboards in Superset. We’ll show you how to connect Superset to a new database and configure a table in that database for analysis. You’ll also explore the data you’ve exposed and add a visualization to a dashboard so that you get a feel for the end-to-end user experience.
Superset itself doesn't have a storage layer to store your data but instead pairs with your existing SQL-speaking database or data store.
First things first, we need to add the connection credentials to your database to be able to query and visualize data from it. If you're using Superset locally via Docker compose, you can skip this step because a Postgres database, named examples, is included and pre-configured in Superset for you.
Under the + menu in the top right, select Data, and then the Connect Database option:
{" "}
Then select your database type in the resulting modal:
{" "}
Once you've selected a database, you can configure a number of advanced options in this window, or for the purposes of this walkthrough, you can click the link below all these fields:
{" "}
Please note, if you are trying to connect to another locally running database (whether on host or another container), and you get the message The port is closed., then you need to adjust the HOST to host.docker.internal
Once you've clicked that link you only need to specify two things (the database name and SQLAlchemy URI):
{" "}
As noted in the text below the form, you should refer to the SQLAlchemy documentation on creating new connection URIs for your target database.
Click the Test Connection button to confirm things work end to end. If the connection looks good, save the configuration by clicking the Connect button in the bottom right corner of the modal window:
Congratulations, you've just added a new data source in Superset!
Now that you’ve configured a data source, you can select specific tables (called Datasets in Superset) that you want exposed in Superset for querying.
Navigate to Data ‣ Datasets and select the + Dataset button in the top right corner.
A modal window should pop up in front of you. Select your Database, Schema, and Table using the drop downs that appear. In the following example, we register the cleaned_sales_data table from the examples database.
To finish, click the Add button in the bottom right corner. You should now see your dataset in the list of datasets.
Now that you've registered your dataset, you can configure column properties for how the column should be treated in the Explore workflow:
Superset has a thin semantic layer that adds many quality of life improvements for analysts. The Superset semantic layer can store 2 types of computed data:
SUM(recovered) / SUM(confirmed)) and make them
available as columns for (e.g. recovery_rate) visualization in Explore.
Aggregate functions are allowed and encouraged for metrics.You can also certify metrics if you'd like for your team in this view.
CAST(recovery_rate as float)).
Aggregate functions aren't allowed in calculated columns.Superset has 2 main interfaces for exploring data:
We'll focus on the Explore view for creating charts right now. To start the Explore workflow from the Datasets tab, start by clicking the name of the dataset that will be powering your chart.
You're now presented with a powerful workflow for exploring data and iterating on charts.
As you customize your chart using drop-down menus, make sure to click the Run button to get visual feedback.
In the following screenshot, we craft a grouped Time-series Bar Chart to visualize our quarterly sales data by product line just by clicking options in drop-down menus.
To save your chart, first click the Save button. You can either:
In the following screenshot, we save the chart to a new "Superset Duper Sales Dashboard":
To publish, click Save and goto Dashboard.
Behind the scenes, Superset will create a slice and store all the information needed to create your chart in its thin data layer (the query, chart type, options selected, name, etc).
To resize the chart, start by clicking the Edit Dashboard button in the top right corner.
Then, click and drag the bottom right corner of the chart until the chart layout snaps into a position you like onto the underlying grid.
Click Save to persist the changes.
Congrats! You’ve successfully linked, analyzed, and visualized data in Superset. There are a wealth of other table configuration and visualization options, so please start exploring and creating slices and dashboards of your own.
Access to dashboards is managed via owners (users that have edit permissions to the dashboard).
Non-owner users access can be managed in two different ways. The dashboard needs to be published to be visible to other users.
If you would like to make your dashboard available to other users, click on the Draft button next to the
title of your dashboard.
:::warning Draft dashboards are only visible to the dashboard owners and admins. Published dashboards are visible to all users with access to the underlying datasets or if RBAC is enabled, to the roles that have been granted access to the dashboard. :::
You can mark a dashboard as a favorite by clicking on the star icon next to the title of your dashboard. This makes it easier to find it in the list of dashboards or on the home page.
The following URL parameters can be used to modify how the dashboard is rendered:
standalone:
0 (default): dashboard is displayed normally1: Top Navigation is hidden2: Top Navigation + title is hidden3: Top Navigation + title + top level tabs are hiddenshow_filters:
0: render dashboard without Filter Bar1 (default): render dashboard with Filter Bar if native filters are enabledexpand_filters:
0: render dashboard with Filter Bar collapsed1: render dashboard with Filter Bar expandedFor example, when running the local development build, the following will disable the
Top Nav and remove the Filter Bar:
http://localhost:8088/superset/dashboard/my-dashboard/?standalone=1&show_filters=0