> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lightdash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# The Explore view

> Query a table, sort and chart the results, and save the chart

A **Table** is the starting point for querying data in Lightdash. It groups related dbt models with the [dimensions](/semantic-layer/dimensions) and [metrics](/semantic-layer/metrics) defined on them, and you query it in the **Explore view**.

To start a query, click `[+] New` → `Query from tables`, then pick the table you want to explore.

<Frame>
  <img src="https://mintcdn.com/lightdash/y8j5qvbhHoP381ni/images/explore/explore-view/new-query-from-tables.png?fit=max&auto=format&n=y8j5qvbhHoP381ni&q=85&s=ebc7daefdc34ca6594d73e073a9965d7" alt="The Query from tables option in the New menu" width="2031" height="1253" data-path="images/explore/explore-view/new-query-from-tables.png" />
</Frame>

## 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

<Frame>
  <img src="https://mintcdn.com/lightdash/y8j5qvbhHoP381ni/images/explore/explore-view/explore-areas.png?fit=max&auto=format&n=y8j5qvbhHoP381ni&q=85&s=b40f6db560b047339d17cad750202bf7" alt="The five areas of the Explore page" width="2550" height="1668" data-path="images/explore/explore-view/explore-areas.png" />
</Frame>

## 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.

<Frame>
  <img src="https://mintcdn.com/lightdash/y8j5qvbhHoP381ni/images/explore/explore-view/select-fields.png?fit=max&auto=format&n=y8j5qvbhHoP381ni&q=85&s=ba2ab5ccf0d5f23ed98993be728a55d2" alt="Selecting a metric and two dimensions in the Explore sidebar" width="2540" height="1586" data-path="images/explore/explore-view/select-fields.png" />
</Frame>

## 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](/explore/explore-view/filter).

## Sort results

Click the arrow in the table header for the field you want to sort by.

<Frame>
  <img src="https://mintcdn.com/lightdash/y8j5qvbhHoP381ni/images/explore/explore-view/sort-results.png?fit=max&auto=format&n=y8j5qvbhHoP381ni&q=85&s=d815ddc4ba1d73ac39c937fdff830c9d" alt="Sorting the results table by a column header" width="1825" height="1102" data-path="images/explore/explore-view/sort-results.png" />
</Frame>

To sort by multiple fields, click the blue pill showing the current sort, then choose `+ Add sort`.

<Frame>
  <img src="https://mintcdn.com/lightdash/y8j5qvbhHoP381ni/images/explore/explore-view/sort-multiple.png?fit=max&auto=format&n=y8j5qvbhHoP381ni&q=85&s=e18da7fbd8c04dc7ffc9c84cab16e83d" alt="The sort menu with multiple sort rules" width="1820" height="1160" data-path="images/explore/explore-view/sort-multiple.png" />
</Frame>

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.

<Frame>
  <img src="https://mintcdn.com/lightdash/y8j5qvbhHoP381ni/images/explore/explore-view/sort-null-values.png?fit=max&auto=format&n=y8j5qvbhHoP381ni&q=85&s=73ed3dd5e47854aa8ab7aebdc1f174ed" alt="The NULL sorting control in the sort menu" width="1206" height="317" data-path="images/explore/explore-view/sort-null-values.png" />
</Frame>

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](/explore/chart-types).

<Frame>
  <img src="https://mintcdn.com/lightdash/y8j5qvbhHoP381ni/images/explore/explore-view/build-chart.png?fit=max&auto=format&n=y8j5qvbhHoP381ni&q=85&s=f49ad666994defe14920da890c4b7b34" alt="Choosing a chart type for query results" width="2547" height="1571" data-path="images/explore/explore-view/build-chart.png" />
</Frame>

## 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.

<Frame>
  <img src="https://mintcdn.com/lightdash/y8j5qvbhHoP381ni/images/explore/explore-view/save-your-chart.png?fit=max&auto=format&n=y8j5qvbhHoP381ni&q=85&s=a5aea554040b0e98d6cbc00ece09f98a" alt="The Save chart button in the Explore view" width="2561" height="1240" data-path="images/explore/explore-view/save-your-chart.png" />
</Frame>

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:

* [Version history](/explore/version-history)
* [Scheduled deliveries](/explore/create-scheduled-deliveries)
* [Google Sheets syncs](/integrations/google-sheets)
* [Alerts](/explore/create-alerts)

### 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](/explore/spaces) 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](/explore/pinning).

You get a saved chart view you can share with others.

<Frame>
  <img src="https://mintcdn.com/lightdash/y8j5qvbhHoP381ni/images/explore/explore-view/saved-chart.png?fit=max&auto=format&n=y8j5qvbhHoP381ni&q=85&s=5847e47ba0b6deb219d91b60d474bc98" alt="The saved chart view" width="2558" height="1675" data-path="images/explore/explore-view/saved-chart.png" />
</Frame>

## 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.

<Frame>
  <img src="https://mintcdn.com/lightdash/y8j5qvbhHoP381ni/images/explore/explore-view/change-chart-explore.png?fit=max&auto=format&n=y8j5qvbhHoP381ni&q=85&s=f0d37b82340174bca9cb3eb826f83676" alt="The Change explore dialog on a saved chart" width="652" height="387" data-path="images/explore/explore-view/change-chart-explore.png" />
</Frame>

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.

<Tip>
  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.
</Tip>
