Skip to main content
Using comparison

Examples

Using comparison

Using comparison

Attributes

string
required
The id of the comparison selector to be used in SQL query templates
array
Optional array of preset comparison values to show. If not provided, all comparison options will be available.
string
Default comparison to select on loadAllowed values:
  • prior year
  • prior period
  • target
  • benchmark
string
default:"Comparison"
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:"triangle"
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 comparison value with quotes. Returns an empty string when no value is selected.
Example value: 'prior year'

.literal

Returns the raw unescaped selected value.
Example value: prior year

.compare_vs

Returns the comparison type. Example value: prior year

.comparison

Returns the full comparison configuration as JSON. Use {{comp}} directly with compare_vs to dynamically configure comparisons.
Example value: {"compare_vs": "prior year"}

.agg

For benchmark comparisons: returns the aggregation function. Example value: avg

.subject

For benchmark comparisons: returns the subject column that defines entities. Example value: region

.target

For target comparisons: returns the target value or expression. Example value: 100000

Allowed Children