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

# Filtering

> An in depth guide for setting up filters

## Overview

Dashboards in Upsolve are **source agnostic**. This means that multiple charts backed by multiple data sources may co-exist on the same dashboard. This provides endless flexibility to dashboard builders, but also requires filtering to be built on a set of rails that is different from traditional BI tools.

The basic concept is that there are [chart filters](#chart-filters) and [dashboard filters](#dashboard-filters). A **dashboard** filter can only be configured to point to one or more **chart** filters. This ensures a consistent behavior for the chart, whether it is being viewed/filtered as a standalone experience, or as part of a dashboard.

## Chart filters

To create a chart filter, go into the chart editor and select the `Configure filters` tab.

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-1.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=97cdcbdbf80c00663788679159bda96e" alt="Filter Guide 1" width="2850" height="1140" data-path="images/filters/filters-guide-1.png" />

There are 3 things you can filter on:

**1. Raw backing tables:** filter any column in the raw data that is powering this specific chart

**2. Computed table:** filter any column from the data table that was computed by the SQL written for this chart

**3. Variables in the chart SQL:** inject variables into the SQL code that is backing this chart

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-2.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=d0f5a9fb16a05c9d29d08259f85f3ee4" alt="Filter Guide 2" width="2850" height="1140" data-path="images/filters/filters-guide-2.png" />

There are 3 steps to configuring a filter:

**1. Table:** select the table to filter or "Query variables"

**2. Column:** select the column or variable to filter on

**3. Filter:** configure the filter as needed. Options will be provided based on the type of filter selected

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-3.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=5f7c17966d00e6ab1792ade2c9fd3dbe" alt="Filter Guide 3" width="2850" height="1150" data-path="images/filters/filters-guide-3.png" />

Once the filter is added, navigate back to the `Chart Builder` tab to check it out. Click the blue filter icon to see all available filters. Setting one will add the filter to your chart

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-4.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=383169f47b7338bce996c092df60234b" alt="Filter Guide 4" width="2828" height="1268" data-path="images/filters/filters-guide-4.png" />

If you are happy with your result, `Save` the chart and let's configure this in the dashboard!

## Dashboard filters

To create a dashboard filter, go into the dashboard editor and click the `+ New filter` button.

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-5.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=e3247ed45f04e4e59205e54ea3f3ed02" alt="Filter Guide 5" width="2888" height="1888" data-path="images/filters/filters-guide-5.png" />

Give your filter a name, and set the type and subtype. In this case, we are going to set a `Select` filter with multiple options allowed.

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-6.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=37aefcea42af44d39c69c8beef7f904d" alt="Filter Guide 6" width="1934" height="1744" data-path="images/filters/filters-guide-6.png" />

Note that there are only 2 charts on this dashboard that have `Select` filters avaialble for us to map to. Select the ones that this dashboard filter should map to. In this case, it will be `Expense Status 2` in both `Total Spend ($) (Copy)` and `Daily Spend Trend (Copy)`. Click the **green (+) button** next to each filter you want to target and you will see this:

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-7.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=9a8ee39ba8fc1e8fd7f7f9a8f23411fb" alt="Filter Guide 7" width="1920" height="1744" data-path="images/filters/filters-guide-7.png" />

<img src="https://mintcdn.com/upsolve/yVBH_AMGbDrqmL40/images/filters/filters-guide-8.png?fit=max&auto=format&n=yVBH_AMGbDrqmL40&q=85&s=9e39646a3176d8d7b85929c1b3843349" alt="Filter Guide 8" width="1922" height="1906" data-path="images/filters/filters-guide-8.png" />

Now, there are more expense statuses I want to map to, but the charts that are in this dashboard don't yet have those filters created on them. We can add them from this menu. Click the `# charts with no Select filter shown` button to reveal the other charts. Pick the one you want, such as `Spend by Merchant (Copy)`. Configure it to be a `Select` filter and preview to make sure things worked.

<img src="https://mintcdn.com/upsolve/yVBH_AMGbDrqmL40/images/filters/filters-guide-9.png?fit=max&auto=format&n=yVBH_AMGbDrqmL40&q=85&s=1f07c70fc7c2fb2045e82544d5eb69f9" alt="Filter Guide 9" width="1896" height="760" data-path="images/filters/filters-guide-9.png" />

Add the filter and hit `Save` to make sure it's added. You will see the filter show up above the panel you are in with a green **(+)** icon. Note that if this filter was not configured as a `Select` filter, it would not appear in this case. This is because chart filters are only shown if they match the dashboard filter type exactly.

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-10.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=412a621a521708b63f484cfd7d579908" alt="Filter Guide 10" width="1898" height="1506" data-path="images/filters/filters-guide-10.png" />

You may now click the **green (+) icon** to add this newly configured chart filter to the target list of this filter

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-11.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=6703971a10b058227bfc8bd207c8bcf9" alt="Filter Guide 11" width="1888" height="1216" data-path="images/filters/filters-guide-11.png" />

Finally, use the filter preview to confirm that everything is working as expected.

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-12.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=ba7afef2b8e5a0155fcecabfb4fb2422" alt="Filter Guide 12" width="1904" height="606" data-path="images/filters/filters-guide-12.png" />

Ther filter may now be set on the dashboard level. Note that all charts that the filter is connected to are filtered.

<img src="https://mintcdn.com/upsolve/K_3XAKoFAbXHl92p/images/filters/filters-guide-13.png?fit=max&auto=format&n=K_3XAKoFAbXHl92p&q=85&s=7b5c9e15046cc87b4009819db72255f2" alt="Filter Guide 13" width="2856" height="1738" data-path="images/filters/filters-guide-13.png" />
