0

Here is what my data looks like:

enter image description here

I would like to see a roll up of the total impressions, total clicks and average ctr for a given query. E.g.,

enter image description here

Except this is just an average of the ctr column values; whereas I need a weighted average.

I think this SO answer Calculate Weighted Average in sql for duplicate items is taking me most of the way there, but since this calculation involves two metrics (ie, impressions and clicks), it's a bit different.

Community
  • 1
  • 1
Drewdavid
  • 3,071
  • 7
  • 29
  • 53

0 Answers0