Skip to main content
A Table is the starting point for querying data in Lightdash. It groups related dbt models with the dimensions and metrics defined on them, and you query it in the Explore view. To start a query, click [+] NewQuery from tables, then pick the table you want to explore.
The Query from tables option in the New menu

The Explore page

The Explore page is made up of five areas:
  1. Metrics and dimensions available on the table you selected
  2. Filters, which restrict the data in your query
  3. Chart, where you visualize the results
  4. Results, the raw data returned from your database
  5. SQL, the generated SQL that produced the results
The five areas of the Explore page

Select your fields

To run a query:
  1. Select a metric to calculate.
  2. Select one or more dimensions to split the metric into groups.
  3. Hit Run query in the top right.
For “number of orders per month split by partner”, that’s the Order count metric with the Order month and Partner name dimensions.
Selecting a metric and two dimensions in the Explore sidebar

Filter results

Filters restrict the rows your query returns. You can add them from the Filters section, from a column header in the results table, or from the field list in the sidebar — see filtering in the Explore view.

Sort results

Click the arrow in the table header for the field you want to sort by.
Sorting the results table by a column header
To sort by multiple fields, click the blue pill showing the current sort, then choose + Add sort.
The sort menu with multiple sort rules
The sort menu behaves like this:
  1. Adding a sort by clicking a column header overwrites any previous rules.
  2. Once you’re sorting by multiple columns, you can drag and drop them to rearrange the order.
  3. Remove a sort by clicking the X to its right.
  4. Change the direction of a column’s sort with the toggle next to its field name.

Sorting NULL values

You can specify whether NULL values appear first, last, or follow your database’s default.
The NULL sorting control in the sort menu
  1. Open the sort menu by clicking the blue pill that displays the current sort.
  2. For each sort field, use the NULL sorting control to pick Nulls first, Nulls last, or Default.
The choice is applied to the generated SQL as a NULLS FIRST or NULLS LAST clause in the ORDER BY statement.

Build a chart

Once the query runs, your data appears in the results table. Open the Chart section and choose a chart type — see chart types and configurations.
Choosing a chart type for query results

Save your chart

Saving a chart lets you share it, add it to a dashboard, or come back to it later. A saved chart re-runs its query every time you open it, so it always shows the latest data in your database.
The Save chart button in the Explore view
Click Save chart at the top of the page, then give the chart a useful name and description. You’ll have the option to save it to a dashboard or a space. Once a chart is saved, it unlocks:

Saving to a dashboard

Most charts in Lightdash are saved directly to a dashboard. This is the better option when a chart is only ever going to be used on one dashboard, and it keeps your spaces free of long lists of charts that only make sense in one context. A chart saved to a dashboard lives only in that dashboard. To reuse it, move it to a space, or click Explore from here and save a new version of the chart.

Saving to a space

A chart saved to a space can be shared on its own and reused across multiple dashboards. It’s also the only way to pin a single chart to your project home page. You get a saved chart view you can share with others.
The saved chart view

Explore from an existing chart

Saved charts and dashboard tiles make good starting points for exploration. Explore from here gives you a copy of the same chart to play with, and nothing you do to it affects the original — so you can explore without worrying about breaking anything.

Changing the explore of an existing chart

Once a chart is saved, you can switch the explore (table) it’s built on without recreating it. Open the saved chart, open the Change explore dialog, and pick the new explore; all field references are remapped to it.
The Change explore dialog on a saved chart
Tick Also update all other charts using this explore to remap every chart built on the current explore in one go — useful when an entire model is being replaced. Fields that exist on the new explore with the same field IDs are kept; anything that doesn’t exist there is dropped, and you’ll need to re-pick the missing fields before saving.
A handy use case is migrating charts from one model to another — for example, when you rename a dbt model or replace it with a different version. Instead of rebuilding the charts from scratch, point them at the new explore and keep the configuration that still applies.

Filtering in the Explore view

Add filters from the Filters tab, the field sidebar, or the results table, and nest them into groups