Filters.

Add a control to a dashboard, bind it to a variable name, and every tile whose source uses that variable refreshes when you change it.

How they work

A filter is a control — a date picker, a multi-select, a number input — that maps to a Python variable. The source cells behind your tiles already reference that variable via {{ var }} interpolation in SQL cells or plain Python in code cells. Change the filter, the variable changes, the cells re-run, the tiles update.

A dashboard with a filter bar across the top: date range, region multi-select, and a numeric threshold./docs-images/dashboards/filter-bar.png
Filters live above the grid and stay visible while you scroll.

Adding a filter

Click + Filter in the dashboard toolbar and pick a type:

  • Date / Date range — single date or range; outputs a date or a (start, end) tuple.
  • Select — single-choice dropdown. Static options or sourced from a query.
  • Multi-select — same, with multi.
  • Text — free-form string.
  • Number / Number range — single or min-max.
  • Toggle — boolean.

Each filter has a Variable name field. Pick a name that matches whatever your source cells expect — for example, region if your SQL contains WHERE region = {{ region }}.

-- Source SQL behind a chart tile, parameterized by 'region' and 'since'
SELECT date_trunc('day', created_at) AS day, sum(amount) AS rev
FROM orders
WHERE region IN {{ region }}
  AND created_at >= {{ since }}
GROUP BY 1 ORDER BY 1;

Cross-tile refresh

When a filter changes, Orchid finds every cell that uses its variable, re-runs them in dependency order, and refreshes their tiles. Tiles with no dependency on the filter stay as they are.

Tiles that depend on multiple filters wait until all of their inputs settle, then re-run once. No flicker, no redundant queries.

Tip

Give every filter a sensible default. A dashboard that doesn't render until the viewer has picked every dropdown feels broken; one that opens with last 30 days / all regions / all channels feels finished.

Sourcing options from a query

Select and multi-select filters can pull their options from another SQL cell. Point the filter at the cell, pick a value column and an optional label column, and the dropdown stays in sync with the underlying data.

-- Cell named "region_options"
SELECT DISTINCT region AS value, region AS label
FROM orders ORDER BY value;

Filters in published dashboards

Filters work the same way in a published view as they do locally — viewers can change them, and the dashboard re-renders. Auto-refresh schedules respect filter defaults; ad-hoc viewer changes happen client-side without re-querying your warehouse (unless the dashboard is on a per-viewer refresh schedule).

Heads up

Filters can't change which cell a tile points at — only the variables that flow through. To swap whole cells (e.g. switch the headline chart between two metrics), use two dashboards or a tabbed layout.

Up next: Sharing, or revisit tile types. Back to the Dashboards overview.