
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 monthsprevious weekprevious monthprevious quarterprevious yearthis weekthis monththis quarterthis yearnext weeknext monthnext quarternext yearweek to datemonth to datequarter to dateyear to dateall 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 monthsprevious weekprevious monthprevious quarterprevious yearthis weekthis monththis quarterthis yearnext weeknext monthnext quarternext yearweek to datemonth to datequarter to dateyear to dateall time
Array of date range keys to show in the preset list. If not provided, the default preset set is used. Forward-looking
this ... and next ... presets are not shown by default and must be explicitly included here. 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
