Glossary/Semantic Layer & Metrics

Metric Definition

A metric definition is a formal specification of what a metric is, how it is calculated, which dimensions it supports, and what rules or limitations apply.

A metric definition goes beyond a simple formula. It includes the calculation logic (sum of orders where status equals completed), the grain (daily, monthly, total), valid dimensions (product category, region, customer segment), filters or conditions (exclude test accounts), and metadata (owner, last updated, freshness SLA). The definition is structured so it can be referenced programmatically: BI tools, APIs, and dashboards can look up the definition and apply it consistently.

Metric definitions solve the problem of implicit assumptions. When a metric lives only in someone's SQL query, the definition is hidden: colleagues don't know whether revenue includes refunds, how multi-currency is handled, or whether it's a sum or average. A metric definition makes these explicit and discoverable. Definitions are typically YAML-based or stored in a metrics platform, version-controlled, and auditable.

Metric definitions enable metric composition: building new metrics from existing ones. For example, "profit margin" is defined in terms of "revenue" and "cost" metrics. When revenue changes, profit margin automatically reflects it. Definitions also support dimension bindings: specifying that a metric only makes sense with certain dimensions (e.g., "session duration" requires user ID or session ID).

Key Characteristics

  • Explicit calculation formula with supporting logic
  • Specifies valid dimensions and filter combinations
  • Documents assumptions and limitations
  • Version-controlled with change history
  • Includes ownership and freshness metadata
  • Supports metric composition and reuse

Why It Matters

  • Clarity: Removes ambiguity about what a metric is
  • Consistency: Same definition applies across all tools and contexts
  • Composability: Build complex metrics from simpler ones
  • Auditability: Track metric changes and who made them
  • Discoverability: Metric definitions act as queryable documentation

Example

`
metric:
  name: monthly_recurring_revenue
  owner: finance_team
  description: Sum of active subscription values
  calculation: SUM(subscription_value) 
  where: status = 'active' AND subscription_start_date <= CURRENT_DATE
  dimensions: [product, region, customer_segment]
  grain: month
  freshness_sla: 24_hours
`

Coginiti Perspective

In SMDL, a metric definition is a measure declaration specifying the source expression, aggregation_type, and optional visibility. The 12 supported aggregation types (count, count_distinct, sum, avg, max, min, median, stdev, stdevp, var, varp, custom) cover standard statistical needs, while the custom type accepts arbitrary SQL for complex business calculations. These definitions are stored as code in .smdl files within the Analytics Catalog, so metric definitions follow the same version control and code review workflow as any other code artifact.

See Semantic Intelligence in Action

Coginiti operationalizes business meaning across your entire data estate.