Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor discrepancy between model spend and Snowflake actuals #25

Open
aphethean1 opened this issue Nov 21, 2022 · 0 comments
Open

Minor discrepancy between model spend and Snowflake actuals #25

aphethean1 opened this issue Nov 21, 2022 · 0 comments

Comments

@aphethean1
Copy link
Contributor

When comparing the monthly spend from daily_spend vs Snowflake actuals, there is a minor discrepancy of a few cents.

This is most easily seen on our account by directly selecting metering_history. The correct amount (in terms of matching Snowflake invoice) is achieved by rounding, then sum. Within the model this is also true, but would prefer a test to prove the results.

-- invoice amount April $35.05
-- without rounding April $35.08

SELECT 
  date_trunc(month, convert_timezone('UTC', start_time))::date as month,
  sum(round(credits_used,2)) + sum(round(credits_used_compute,2)) + sum(round(credits_used_cloud_services,2))
FROM snowflake.account_usage.metering_history
WHERE date_trunc(month, start_time)::date = '2022-04-01'
GROUP BY 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant