Skip to main content
Basic Usage
{% 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 loadAllowed values:
  • prior year
  • prior period
  • target
title
String
default:"Comparison"
Text displayed above the selector
info
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)
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.