Created
August 27, 2025 13:57
-
-
Save cnolanminich/bb1d8fd7738dbc6c4f1c320486a378fb to your computer and use it in GitHub Desktop.
high velocity credits for current POC customers / dagster+ customers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with daily as( | |
| select | |
| ds::date as reporting_date, | |
| sum(standard_credits) as daily_standard_credits, | |
| sum(high_velocity_credits) as daily_high_velo_credits, | |
| daily_standard_credits + daily_high_velo_credits as total_credits_daily | |
| from purina.product.usage_metrics_daily | |
| where usage_metrics_daily.organization_id = {org_id here} | |
| group by ds::date | |
| ) | |
| select | |
| date_trunc('week', reporting_date) as reporting_week, | |
| sum(daily_standard_credits) as weekly_standard_credits, | |
| sum(daily_high_velo_credits) as weekly_high_velo_credits, | |
| sum(total_credits_daily) as weekly_total_credits, | |
| weekly_high_velo_credits / weekly_total_credits * 100 as percent_high_velo | |
| from daily | |
| group by reporting_week |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment