Skip to main content

Using filters

To learn more about using filters, check out our docs on limiting data using filters.

Filter types

Numeric filters

String filters

Boolean filters

Date filters

Date/Timestamp Filter Reference Guide

The below examples show possible date/timestamp filter combinations and their corresponding SQL outputs. All examples use BigQuery syntax and assume:
  • Current timestamp: 2025-10-24 15:30:00
  • Example field: orders.created_at
  • Timezone: UTC
  • Week starts on Monday

Timestamp filter examples

Current Period Filters

Current (In The Current)

Past Period Filters

Last N Periods (in the last)
Last N Completed Periods (in the last, Completed)

Future Period Filters

Next N Periods (In The Next)
Next N Completed Periods (In The Next, Completed)
Within Custom Range

Notes

  1. Completed periods always:
    • Start at the beginning of a period (00:00:00)
    • End at the beginning of the next period
    • Don’t include partial periods
  2. Rolling periods (non-completed):
    • Use the current time as the reference point
    • Look backward/forward the specified amount
    • Include partial periods
  3. Current periods:
    • Always start at the beginning of the current period
    • End at the beginning of the next period
    • Example: Current month starts at 1st of the month
  4. Week handling:
    • By default, weeks start on the default day configured in your database
    • You can configure this to a different day in your database connection settings
    • Week boundaries are always at midnight (00:00:00)

Is period-to-date

The is period-to-date filter returns rows at or before the current position within their period, across every period in your data. Pick a unit — week, month, quarter, or year — and Lightdash filters each period down to the same relative point as today. For example, if today is the 15th of the month, in the month-to-date:
  • Includes rows dated on or before the 15th of any month (Jan 1–15, Feb 1–15, Mar 1–15, …), not just this month.
  • Is designed for like-for-like comparisons across periods, such as this MTD versus the same MTD in prior months.
When to use in the period-to-date vs. in the current:
is period-to-date is only available on Explore, chart, and dashboard filters. It is not supported as a YAML metric filter in your dbt project.

Date filter examples

Current Period Filters

Current (In The Current)

Past Period Filters

Last N Periods (in the last)
Last N Completed Periods (in the last, Completed)

Future Period Filters

Next N Periods (In The Next)
Next N Completed Periods (In The Next, Completed)
Within Custom Range

Notes

  1. Key differences from timestamp filters:
    • No time components in any filters
    • Single day comparisons use equality (=) instead of ranges
    • DATE() function used instead of TIMESTAMP()
  2. Completed periods always:
    • Start at the beginning of a period
    • End at the beginning of the next period
    • Don’t include partial periods
    • For single days, use equality instead of ranges
  3. Rolling periods:
    • Use the current date as the reference point
    • Count in full days (N days forward/backward)
    • Include the current date in the range
  4. Current periods:
    • For single day: use equality
    • For longer periods: use standard ranges
    • Example: Current month is all days from 1st to last day
  5. Week handling:
    • Weeks start on Monday by default
    • Can be configured to start on Sunday
    • Full days only, no time components