SAW ranking


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select rank() over (order by R.CombinedRatio desc) as Rank, R.Id as [User Link]
    , R.CombinedRatio, R.SVRatio, R.ScoreRatio, R.TotalScore, R.NumAnswers
from (
  select U.Id
    , sum(A.Score) as TotalScore
    , count(A.Id) as NumAnswers
    , sum(1000 * cast(A.Score as float(53)) / Q.ViewCount) / count(A.Id) as SVRatio
    , cast(sum(A.Score) as real) / count(A.Id) as ScoreRatio
    , sum(1 - cast(1 as float(53))/(((1/80)*cast(A.Score as float(53)) + 1))
    * (1 + 9*exp(-4.12*cast(Q.ViewCount as float(53))/10000)))
      / count(A.Id) as CombinedRatio
  from Posts A
  inner join Posts Q on Q.Id = A.ParentId
  inner join Users U on U.Id = A.OwnerUserId
  where A.PostTypeId = 2
    and A.CommunityOwnedDate is null -- Excluding CW answers.
  group by U.Id, U.Reputation
  having count(A.Id) >= ##MinimumAnswerCount?150##
  ) R
where R.ScoreRatio >= ##MinimumScoreRatio?0##
order by R.CombinedRatio desc

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results