1. Learn
  2. /
  3. Courses
  4. /
  5. Data Pipeline Automation in Snowflake

Connected

Exercise

Running totals with SUM

Harbr's finance team wants to track how credit consumption accumulates over time for each warehouse. You'll build a running total using SUM() as a window function on logistics.warehouse_usage, which contains warehouse_name, usage_month, and credits_used.

Instructions

100 XP
  • Select warehouse_name, usage_month, and credits_used.
  • Add a running_total column using SUM(credits_used) partitioned by warehouse_name and ordered by usage_month.
Powered by Snowflake