Metric Delta
How a metric's change is computed: against the previous row ('compare': "previous", the same aggregate without the last kept row), against a baseline ('compare': { filter }, the same aggregate over the rows that meet this filter instead of the metric's own), against a fixed number ('compare': { value }), or read from a column that already holds it ('field'). Exactly one of 'compare' and 'field'. 'previous' compares row sets, not periods: with several rows per period, filter to one series first or have the host write the change in a column and use 'field'.
Metadata
Field index
| Field | Type | Req. | Description |
|---|---|---|---|
| compare | const | object | object | — | What the value is compared with.
|
| field | string | — | A column that holds the change. The change is the metric's aggregate over the same rows of this column. An unknown name is a 'dataset-field-unknown' error. |
| as | enum | — | With 'compare': the change as a difference (value minus base) or as a ratio ((value minus base) over the absolute base; 0.12 is 12%). With 'field': what the column holds, which only picks the default format.
|
| format | ref:NumberFormat | — | How the change is drawn, usually with sign sections ('+0.0;-0.0;0', '+0%;-0%;0%'). Absent: the value column's format with sign sections built from it ('+#,##0.##;-#,##0.##;0' without one), and '+0%;-0%;0%' for a percent. |
compare
typeconst | object | objectrequirednodefault—
What the value is compared with.
compare· Named choices (see schema for other values and constraints)"previous"compare (oneOf 2).filter[].op· Allowed values"=""!=""<""<="">"">=""in"
{
"compare": "previous"
}field
typestringrequirednodefault—
A column that holds the change. The change is the metric's aggregate over the same rows of this column. An unknown name is a 'dataset-field-unknown' error.
as
typeenumrequirednodefaultdifference
With 'compare': the change as a difference (value minus base) or as a ratio ((value minus base) over the absolute base; 0.12 is 12%). With 'field': what the column holds, which only picks the default format.
as· Allowed values"difference""percent"
{
"as": "difference"
}format
typeref:NumberFormatrequirednodefault—
How the change is drawn, usually with sign sections ('+0.0;-0.0;0', '+0%;-0%;0%'). Absent: the value column's format with sign sections built from it ('+#,##0.##;-#,##0.##;0' without one), and '+0%;-0%;0%' for a percent.
oneOf 1 · object
Exact constraints for oneOf 1
{
"required": [
"compare"
]
}oneOf 2 · object
Exact constraints for oneOf 2
{
"required": [
"field"
]
}Complete definition constraints
{
"type": "object",
"additionalProperties": false,
"description": "How a metric's change is computed: against the previous row ('compare': \"previous\", the same aggregate without the last kept row), against a baseline ('compare': { filter }, the same aggregate over the rows that meet this filter instead of the metric's own), against a fixed number ('compare': { value }), or read from a column that already holds it ('field'). Exactly one of 'compare' and 'field'. 'previous' compares row sets, not periods: with several rows per period, filter to one series first or have the host write the change in a column and use 'field'.",
"oneOf": [
{
"required": [
"compare"
]
},
{
"required": [
"field"
]
}
],
"properties": {
"compare": {
"description": "What the value is compared with.",
"oneOf": [
{
"const": "previous"
},
{
"type": "object",
"additionalProperties": false,
"required": [
"filter"
],
"properties": {
"filter": {
"$ref": "#/$defs/DataFilter",
"description": "The rows the baseline is computed over. It replaces the metric's own filter instead of adding to it, so it names everything it means."
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"value"
],
"properties": {
"value": {
"$ref": "#/$defs/FiniteNumber",
"description": "A fixed number to compare with: a plan, a budget, last year's figure typed in."
}
}
}
],
"examples": [
"previous",
{
"filter": [
{
"field": "Month",
"op": "=",
"value": "2026-09"
}
]
},
{
"value": 4
}
]
},
"field": {
"type": "string",
"description": "A column that holds the change. The change is the metric's aggregate over the same rows of this column. An unknown name is a 'dataset-field-unknown' error."
},
"as": {
"type": "string",
"enum": [
"difference",
"percent"
],
"default": "difference",
"description": "With 'compare': the change as a difference (value minus base) or as a ratio ((value minus base) over the absolute base; 0.12 is 12%). With 'field': what the column holds, which only picks the default format."
},
"format": {
"$ref": "#/$defs/NumberFormat",
"description": "How the change is drawn, usually with sign sections ('+0.0;-0.0;0', '+0%;-0%;0%'). Absent: the value column's format with sign sections built from it ('+#,##0.##;-#,##0.##;0' without one), and '+0%;-0%;0%' for a percent."
}
}
}