All the views (log scaled)

1

Please login or register to vote for this query.

(click on this box to dismiss)

http://meta.stackexchange.com/questions/244534/were-working-on-a-new-stat-to-help-convey-the-reach-of-your-posts-here

Meta Stack Exchange

Q&A about the Stack Exchange Network

with question_score as (
select power(log10(ViewCount), 5) ask_views, 
ViewCount,
       OwnerUserId UserId, 
       Id PostId
from Posts
where PostTypeId = 1
      and AnswerCount > 0
      and Score > 0
      and CommunityOwnedDate is null
group by OwnerUserId, Id, ViewCount, AnswerCount
),

answer_score as (
select power(log10(q.ViewCount), 5) answer_views, 
       q.ViewCount,
       a.OwnerUserId UserId, 
       a.Id PostId
from Posts q
     join Posts a on (q.Id = a.ParentId)
where a.Score > 0
      and a.CommunityOwnedDate is null
group by a.OwnerUserId, a.Id, q.ViewCount, a.Score
)

select OwnerUserId as [User Link],
       round(sum(ask_views), 0) ask_score,
       sum(q.ViewCount) q_views,
       round(sum(answer_views), 0) answer_score,
       sum(a.ViewCount) a_views,
       round(sum(isnull(answer_views, 0)) 
             + isnull(sum(ask_views), 0), 0) total_score
from question_score q
     full outer join Posts p on (q.PostId = p.Id)
     full outer join answer_score a on (p.Id = a.PostId)
where OwnerUserId in (##UserId##)
group by OwnerUserId

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results