Vine
Vine

Reputation: 395

Two different numbers after an average inside Google Big Query and Data Studio

I am averaging a number, grouped by week inside of Google Data Studio, and i am averaging the same numbers grouped by week inside of Big query however the output is slightly different.

Overall Score

AVG(table.score) OVER (PARTITION BY Weeknum) as OverallScore

The datasource is a list of scores, along with a date. I am averaging this inside DS using the aggregate function within the metric, and using the Time dimension ISO Year Week.

The purpose of this is to have one set of numbers hard coded, whilst the other line is used to filter to different departments, keeping the original "overall" score present to be used as a benchmark.

Exporting my table into excel, i can average it filtered by week 3 (See below) and i it returns 19.59 as well. Meaning, the avg aggregate function inside Datastudio is the same as excel. Also, i can query the table using the below, which rules out an averaging difference inside bigquery. However when i place overall score into the graph below i get slightly different numbers for the overall score..

SELECT avg(overallscore) FROM `dbo.table` where weeknum = '2018 3'

Output = 19.59

![enter image description here

Does anyone have an idea what may be causing this?

Upvotes: 0

Views: 502

Answers (1)

Bobbylank
Bobbylank

Reputation: 1946

When you open the report, you should be able to see the query it runs in your query history in Big Query. Check that it's using the same formula as sometimes it uses approximate aggregates.

Upvotes: 2

Related Questions