SAW ranking

1

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 real) / Q.ViewCount) / count(A.Id) as SVRatio
    , cast(sum(A.Score) as real) / count(A.Id) as ScoreRatio
    , sum(1 - 1/(((1/80)*cast(A.Score as real) + 1))
        * (1 + 9*exp(-4.12*cast(Q.ViewCount/10000 as real))))
      / 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

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