Semaphor

Global Date Filter

Apply one date range across every eligible card on a dashboard.

Overview

A global date filter lets you set one date range at the dashboard level and have every eligible card pick it up automatically — no need to configure the same date filter card by card.

Think of it as the dashboard's default time window. You set it once, and every card built on a semantic dataset respects it.

Plays nicely with your existing filters

The global date filter is additive. It never overwrites or merges with an existing date filter on a card — both stay in effect, so the card behaves predictably.


How it works

There are two ways to configure this:

  • On the dashboard, you add a global date filter. It automatically picks up each card's primary date field, so cards built on different datasets all filter correctly without any per-card setup.
  • On each semantic dataset, you mark one date field as the dataset's primary date field. This is the canonical date the global filter will target.

Which cards does this apply to?

The global date filter works with config-driven cards — the cards you build with the visual editor — whether or not they're on a semantic domain. If a card is on a semantic domain, you can set a primary date field on the dataset to tell the filter which field to use. SQL cards aren't touched by the global filter; they keep filtering exactly as their query defines.


Which date field each card uses (precedence)

When you add a global date filter, Semaphor picks which field to filter on for each card using a simple order of precedence. The goal is straightforward: cards that already have their own date behavior keep that behavior, and everything else picks up the dataset default.

  1. The card is already grouped by a date field. If the card breaks down its data over time (a trend over created_at, a monthly breakdown of order_date, etc.), the global filter targets that field. Grain controls, comparison periods, and any existing date filter on the card keep working just like before.
  2. The dataset's primary date field. If the card is on a semantic domain and you've set a primary date field on the dataset, the filter uses that field.
  3. No date field to use. If a card has neither — no date grouping, and either no semantic domain or no primary date field on its dataset — the filter simply skips it. On semantic-domain cards, that's usually a prompt to set a primary date on the dataset.

Your card-level date filters are safe

If a card already has a date filter of its own on, say, order_date, adding a global range keeps both in effect. Neither one replaces or rewrites the other — they both apply.


Set a primary date field on a dataset

Open a dataset with a date dimension in the semantic domain editor and toggle Set as primary date field on the column you want as its canonical date.

In YAML, it's a single key on the dataset:

datasets:
  - name: orders
    label: "Orders"
    primaryDateField: order_date
    fields:
      dimensions:
        - name: order_date
          label: "Order Date"
          dataType: date

The field you point to has to exist on the dataset and be a date or datetime type. If you rename the field later, the primaryDateField reference updates automatically.

For the full field authoring reference, see Datasets & Fields.


Add a global date filter to a dashboard

Open your dashboard in edit mode, open the filter side panel, and click Add global date filter at the top.

The filter shows up with a Global badge and a default title of Global Date. Click it to open the date picker and pick either a preset — Last 7 days, This month, Year to date, and so on — or a custom range with explicit start and end dates. The range applies to every eligible card immediately.

Default date ranges

You can save the dashboard with a sensible default range — for example, Last 30 days or This month — so it opens on the right window every time. Because the default is relative, it resolves freshly each time a viewer loads the dashboard.


Works alongside your other filters

The global date filter is independent of the other filtering mechanisms on a dashboard:

  • Card-subscribed filters ({{ filters | where }} in SQL queries) keep working exactly as before.
  • Dashboard controls ({{ param('id') }}) keep working exactly as before.
  • Date filters on individual cards keep working exactly as before.

All of them can be active at the same time. If a card needs a different date window than the dashboard default, you can still set one on the card — the global filter just applies on top.

On this page