Metric
Reusable semantic metric. Simple and cumulative metrics require agg; ratio metrics require numerator and denominator; derived metrics require expr and metrics; conversion metrics require base, conversion, and entity.
Stable metric name used by queries and derived-metric references.
Metric calculation type: simple, ratio, derived, cumulative, or conversion.
Possible values: [simple, ratio, derived, cumulative, conversion]
label object
Optional display label for the metric.
- string
- null
description object
Human-readable explanation of the metric.
- string
- null
Alternative terms that may refer to the metric.
Whether the metric can be used for result ordering.
truetrueoptions object
Target-specific metric bindings.
- object
- null
agg object
Aggregation for simple and cumulative metrics. Required for those types.
- string
- null
Possible values: [sum, avg, min, max, count, count_distinct, median, percentile]
expr object
Column or row expression for simple and cumulative metrics, or arithmetic over metrics aliases for a derived metric.
- string
- null
percentile object
Percentile fraction used when agg is percentile.
- number
- null
clauses object[]
Semantic column definition. Capability flags control filtering, sorting, grouping, and catalog visibility; values is exhaustive, samples is illustrative, and dictionary-backed columns suppress both value lists from semantic catalog output.
granularity object
- string
- null
Possible values: [day, week, month, quarter, year]
window object
Running time window for a cumulative metric. It cannot be combined with grain_to_date.
- string
- null
grain_to_date object
Calendar-to-date grain for a cumulative metric. It cannot be combined with window.
- string
- null
Possible values: [day, week, month, quarter, year]
numerator object
Numerator aggregation required for a ratio metric.
- AggSpec
- null
Possible values: [sum, avg, min, max, count, count_distinct, median, percentile]
expr object
- string
- null
percentile object
- number
- null
clauses object[]
Semantic column definition. Capability flags control filtering, sorting, grouping, and catalog visibility; values is exhaustive, samples is illustrative, and dictionary-backed columns suppress both value lists from semantic catalog output.
granularity object
- string
- null
Possible values: [day, week, month, quarter, year]
denominator object
Denominator aggregation required for a ratio metric.
- AggSpec
- null
Possible values: [sum, avg, min, max, count, count_distinct, median, percentile]
expr object
- string
- null
percentile object
- number
- null
clauses object[]
Semantic column definition. Capability flags control filtering, sorting, grouping, and catalog visibility; values is exhaustive, samples is illustrative, and dictionary-backed columns suppress both value lists from semantic catalog output.
granularity object
- string
- null
Possible values: [day, week, month, quarter, year]
base object
Base-event aggregation required for a conversion metric.
- AggSpec
- null
Possible values: [sum, avg, min, max, count, count_distinct, median, percentile]
expr object
- string
- null
percentile object
- number
- null
clauses object[]
Semantic column definition. Capability flags control filtering, sorting, grouping, and catalog visibility; values is exhaustive, samples is illustrative, and dictionary-backed columns suppress both value lists from semantic catalog output.
granularity object
- string
- null
Possible values: [day, week, month, quarter, year]
conversion object
Conversion-event aggregation required for a conversion metric.
- AggSpec
- null
Possible values: [sum, avg, min, max, count, count_distinct, median, percentile]
expr object
- string
- null
percentile object
- number
- null
clauses object[]
Semantic column definition. Capability flags control filtering, sorting, grouping, and catalog visibility; values is exhaustive, samples is illustrative, and dictionary-backed columns suppress both value lists from semantic catalog output.
granularity object
- string
- null
Possible values: [day, week, month, quarter, year]
entity object
Column identifying the entity whose conversion is measured. Required for a conversion metric.
- string
- null
metrics object[]
Metric references available to a derived metric expression. At least one is required for a derived metric.
alias object
- string
- null
offset_window object
- string
- null
{
"name": "string",
"type": "simple",
"label": "string",
"description": "string",
"synonyms": [
"string"
],
"sortable": true,
"visible": true,
"options": {},
"agg": "sum",
"expr": "string",
"percentile": 0,
"clauses": [
{
"column": "string",
"op": "string",
"granularity": "day"
}
],
"window": "string",
"grain_to_date": "day",
"numerator": {
"agg": "sum",
"expr": "string",
"percentile": 0,
"clauses": [
{
"column": "string",
"op": "string",
"granularity": "day"
}
]
},
"denominator": {
"agg": "sum",
"expr": "string",
"percentile": 0,
"clauses": [
{
"column": "string",
"op": "string",
"granularity": "day"
}
]
},
"base": {
"agg": "sum",
"expr": "string",
"percentile": 0,
"clauses": [
{
"column": "string",
"op": "string",
"granularity": "day"
}
]
},
"conversion": {
"agg": "sum",
"expr": "string",
"percentile": 0,
"clauses": [
{
"column": "string",
"op": "string",
"granularity": "day"
}
]
},
"entity": "string",
"metrics": [
{
"name": "string",
"alias": "string",
"offset_window": "string"
}
]
}