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 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))/(cast(A.Score as float(53))/##a?80## + 1))
    * (1 + ##c?9##*exp(-##b?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
  --inner join PostTags PT on PT.PostId = Q.Id
  --inner join Tags T on T.Id = PT.TagId
  where A.PostTypeId = 2
    and A.CommunityOwnedDate is null -- Excluding CW answers.
    and Q.CreationDate >= dateadd(year, -(1+##MaxYearsElapsed?100##), getdate())
    --and T.TagName = '##TagName?c###'
  group by U.Id, U.Reputation
  having count(A.Id) >= ##MinAnswerCount?150##
  ) R
where R.ScoreRatio >= ##MinScoreRatio?0##
order by R.CombinedRatio desc

Enter Parameters

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