
Examples
Using date_grain

Using Inline SQL

Attributes
string
required
The id of the date grain selector to be used in SQL query templates
array
Optional array of preset date grain values to show. If not provided, all date grain options will be available.
string
Default date grain to select on loadAllowed values:
dayweekmonthquarteryearhourday of weekday of monthday of yearweek of yearmonth of yearquarter of year
string
default:"Date Grain"
Text displayed above the selector
string
Information tooltip text
string
URL to link the info text to (can only be used with info)
string
Create a custom link title for the info link, placed after the info text (can only be used with info_link)
string
Placeholder text displayed when no value is selected
string
default:"clock"
Icon to display
number
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.
Available Properties
You can also access specific properties using{{filter_id.property}}:
.selected
Returns the selected date grain value with quotes. Returns an empty string when no value is selected.'month'
.literal
Returns the raw unescaped selected value. Use this with thedate_grain attribute.
month
