Example

{% delta value="sum(total_sales)" /%}

Attributes

data
String
required
Table or view to query
value
String
required
SQL expression to insert into the SELECT part of the query (e.g., “COUNT(*)”, “SUM(sales)”)
fmt
String
Format code for the value (e.g., “num”, “usd”, “pct”). See formatValue documentation for available formats.
text
String
Text appearing after the delta (e.g., vs. prev month)
chip
Boolean
default:"false"
Whether to display as a chip
comparison
Comparison configuration objectExample:
comparison={
  compare_vs = value
  display_type = value
  target = "string"
  down_is_good = true
}
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.
  • down_is_good: boolean - Whether a downward trend is considered positive
show_value
Boolean
default:"true"
Whether to show the value
show_symbol
Boolean
default:"true"
Whether to show the delta symbol
symbol_position
String
default:"right"
Position of the delta symbol relative to the value
neutral_range
Array
default:"[0,0]"
Range [min, max] for neutral values. Use null for infinity (e.g., [null, 0] means anything ≤ 0 is neutral)
filters
Array
IDs of filters to apply to the query
where
String
Custom SQL WHERE condition to apply to the query. For date filters, use date_range instead.
having
String
Custom SQL HAVING condition to apply to the query after GROUP BY
limit
Number
Maximum number of rows to return from the query
order
String
Column name(s) with optional direction (e.g. “column_name”, “column_name desc”)
qualify
String
Custom SQL QUALIFY condition to filter windowed results
date_range
Use date_range to filter data for specific time periods like last 12 months, year-to-date, etcExample:
date_range={
  range = value
  date = "string"
}
Attributes:
  • range: enum
  • date: string
width
Number
Set the width of this component (in percent) relative to the page width