Identify or create the two simple metrics that will serve as the numerator and denominator (e.g., clicks and impressions)
Add a new metric entry with type: ratio and populate the numerator and denominator fields each referencing the corresponding metric name
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)
Run dbt sl query --metrics click_through_rate --group-by campaign_id,metric_time__day to test the output
Add the metric to a saved_queries block for reuse across BI integrations
Known gotchas
Ratio metrics do not accept an expr field; if you need arithmetic beyond a simple numerator/denominator divide, use a derived metric with expr instead
Filters applied at the ratio metric level wrap both numerator and denominator by default; use separate numerator.filter or denominator.filter to apply scoped conditions independently
Division by zero is not handled natively in the metric definition; add a WHERE clause in your BI tool or wrap the downstream query in a NULLIF to guard against zero denominators
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp