Skip to content

Repository files navigation

Analytics Toolkit

Production SQL patterns for marketing and revenue analytics. Built for Snowflake with dbt-compatible syntax.

Contents

FileDescription
campaign_performance.sqlROAS, CPM, CTR, and CPA by campaign
top_n_per_group.sqlTop N results per partition using ROW_NUMBER
budget_pacing.sqlFlag campaigns behind pace vs. expected spend
wow_change.sqlWeek-over-week metric change using LAG

Stack

  • Warehouse: Snowflake
  • Transformation: dbt
  • Use case: Marketing analytics, revenue reporting, campaign performance

Notes

All queries use NULLIF to prevent division by zero. Window function filtering uses Snowflake's QUALIFY clause where applicable.

About

Production SQL patterns for marketing and revenue analytics — Snowflake, dbt

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors