Overview
Where the business voice lives
Semantic models describe the physical shape (tables, entities, measures). metrics.yml describes the business voice — labels, descriptions, filter constraints — and the composition rules.
The four metric kinds, in YAML
| Kind | YAML field | Example |
|---|---|---|
| simple | measure: | revenue := SUM(orders.amount_cents) |
| ratio | numerator/denominator: | aov := revenue / order_count |
| derived | expr: + metrics: | gross_margin := (revenue-cogs)/revenue |
| cumulative | measure: + cumulative_type_params: | revenue_l28d := SUM(amount_cents) over 28d window |
Every metric carries label, description, meta.owner, and optional filter: constraints. The filter: is the feature that makes paying_revenue := revenue WHERE plan != 'free' a first-class metric the LLM and BI can pick like any other — instead of a dangerous one-off WHERE clause baked into a dashboard.