Skip to main content

Example

{% comparison_selector
    id="comparison_type"
    default_value="prior year"
/%}

Attributes

id
String
required
The id of the comparison selector to be used in SQL query templates
preset_values
Array
Optional array of preset comparison values to show. If not provided, all comparison options will be available.
default_value
String
Default comparison to select on load
title
String
default:"Comparison"
Text displayed above the selector
info
String
Information tooltip text
placeholder
String
Placeholder text displayed when no value is selected
icon
String
default:"triangle"
Icon to display
width
Number
Set the width of this component (in percent) relative to the page width

Available Filter Properties

When you reference a comparison selector filter in inline queries using the {{filter_id.property}} syntax, the following properties are available:

.selected

Returns the selected comparison value. Returns an empty string when no value is selected.

.literal

Returns the raw unescaped selected value.
I