Create a MetricFlow ratio metric in YAML to express a rate such as click-through rate from two existing measures

domain: docs.getdbt.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Identify or create the two simple metrics that will serve as the numerator and denominator (e.g., clicks and impressions)
  2. Add a new metric entry with type: ratio and populate the numerator and denominator fields each referencing the corresponding metric name
  3. Optionally add a filter string to either numerator or denominator individually if the rate should be scoped (e.g., only paid impressions in the denominator)
  4. Run dbt sl query --metrics click_through_rate --group-by campaign_id,metric_time__day to test the output
  5. Add the metric to a saved_queries block for reuse across BI integrations

Known gotchas

Related routes

Author a MetricFlow conversion metric in YAML to track funnel conversion rates between two events
docs.getdbt.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans