
Examples
Using date_range

Using where

Using Inline SQL

Attributes
The id of the date range picker to be used in SQL query templates (e.g.,
{{date_filter.between}})Text displayed above the date range picker
Default range preset to select on load. If not specified, defaults to “all time” if available, otherwise uses the first preset in preset_ranges.Allowed values:
last 7 dayslast 30 dayslast 3 monthslast 6 monthslast 12 monthsweek to datemonth to datequarter to dateyear to dateprevious weekprevious monthprevious quarterprevious yearall time
(deprecated) Use default_range instead. Default range preset to select on load.Allowed values:
last 7 dayslast 30 dayslast 3 monthslast 6 monthslast 12 monthsweek to datemonth to datequarter to dateyear to dateprevious weekprevious monthprevious quarterprevious yearall time
Array of date range keys to show in the preset list. If not provided, all presets are shown. When “all time” is excluded and no default is specified, the first preset in this list becomes the default.
Set the width of this component (in percent) relative to the page width
Using the Filter Variable
Reference this filter using{{filter_id}}. The value returned depends on where you use it.
| Context | Default Property | No Selection | Result |
|---|---|---|---|
| Inline SQL query | .between | BETWEEN toDate('2024-01-01') AND toDate('2024-12-31') | |
where attribute | .between | BETWEEN toDate('2024-01-01') AND toDate('2024-12-31') | |
| Text / Markdown | .range | Last 6 Months |
Available Properties
You can also access specific properties using{{filter_id.property}}:
.start
Returns the start date as a date expression.toDate('2024-01-01')
.end
Returns the end date as a date expression.toDate('2024-12-31')
.between
Returns a BETWEEN clause for the date range.BETWEEN toDate('2024-01-01') AND toDate('2024-12-31')
.range
Returns a human-readable description of the selected range. This is the value to use withdate_range attribute.
Last 6 Months
