Example
Comparison
Sparkline
Attributes
Table or view to query
The column name for the main value to display
date_range
Use date_range to filter data for specific time periods. Accepts predefined ranges (e.g., “last 12 months”), dynamic ranges (e.g., “Last 90 days”), custom date ranges (e.g., “2020-01-01 to 2023-03-01”), or partial ranges (e.g., “from 2020-01-01”, “until 2023-03-01”)Example:Attributes:
- range:
enum
- date:
string
comparison
Comparison configuration objectExample:Attributes:
- compare_vs:
enum
- Type of comparison to perform. Options: prior year (same period last year), prior period (previous period of same duration), target (compare against a target value) - display_type:
enum
- What to display for comparison. Options: compared_value (comparison period value), abs (absolute change), pct (percentage change) - target:
string
- Target value for target comparison. Can be a column name, aggregation (e.g., “sum(target_sales)”), or literal value. - abs_fmt:
string
- Format code for absolute values in comparison tooltips - pct_fmt:
string
- Format code for percentage values in comparison tooltips - hide_pct:
boolean
- Hide the percentage change line in comparison tooltips - delta:
boolean
- Whether to display the comparison as a delta - text:
string
- Text displayed after the comparison value - down_is_good:
boolean
- Whether a decrease is considered positive - neutral_range:
array
sparkline
Sparkline configuration objectExample:Attributes:
- type:
enum
- The type of sparkline to display - color:
string
- Color for the sparkline - x:
string
- X column for the sparkline - y_fmt:
string
- Value format for the sparkline tooltips - x_fmt:
string
- Date format for the sparkline tooltips - fit_to_data:
boolean
- Whether to show the Y scale on the sparkline - connect_group:
string
- Connect group for the sparkline - date_grain:
enum
- Time grain for the sparkline data points - date_range:
object
Format for the main value
Title for the main value
Maximum width of the component
Minimum width of the component
Additional CSS classes for the title
Additional CSS classes for the value
URL to link the value to
Information tooltip text
IDs of filters to apply to the query
Custom SQL WHERE condition to apply to the query. For date filters, use date_range instead.
Custom SQL HAVING condition to apply to the query after GROUP BY
Maximum number of rows to return from the query
Column name(s) with optional direction (e.g. “column_name”, “column_name desc”)
Custom SQL QUALIFY condition to filter windowed results
Additional CSS classes for the component
Set the width of this component (in percent) relative to the page width