Skip to main content
Using date_grain

Examples

Using date_grain

Using date_grain

Using Inline SQL

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:
  • day
  • week
  • month
  • quarter
  • year
  • hour
  • day of week
  • day of month
  • day of year
  • week of year
  • month of year
  • quarter of year
string
default:"Date Grain"
Text displayed above the selector
string
Information tooltip text
URL to link the info text to (can only be used with info)
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.
Example value: 'month'

.literal

Returns the raw unescaped selected value. Use this with the date_grain attribute.
Example value: month