GoogleCloudPlatform/bigquery-utils

Incorrect BigQuery billing analytics SQL script

Amskee opened this issue · 1 comments

Issue

BigQuery billing analytics monthly_invoice_costs_credits.sql script uses join to unnest credits and adds them to total cost. This produces duplicate cost rows and incorrect total cost when there is more than one credit applied to the same line item.

image

Fix

Join needs to be replaced with subquery to prevent duplication of rows which fixes the total cost. I have the fix branch ready but I don't have access to push the branch, do let me know the steps to create a PR

#291 fixes this