Users by percent of answers that have negative score

2

Please login or register to vote for this query.

(click on this box to dismiss)

Returns the fraction of each user's answers that have negative score, as well as a link to the answer-score distribution for each user. It includes a threshold by user reputation, total number of answers by the user, as well as the possibility (by re-setting ScoreThreshold) to get the percentage of answers below a user-set threshold.

Latin Language

Q&A for linguists, teachers, and students wanting to discuss the finer points of the Latin language

--site name as per query 516017 for SEDE URLs
DECLARE @siteinit VARCHAR(100), @site VARCHAR(100)
SET @siteinit=REPLACE(LOWER( (SELECT DB_NAME() AS [Current Database]) ),'StackExchange.','')
SET @site = REPLACE(REPLACE(REPLACE( --REPLACE(
CASE
  WHEN @siteinit NOT LIKE '%.Meta' THEN @siteinit
  ELSE 'meta.'+REPLACE(@siteinit,'.Meta','')
  END
  ,'audio','avp') ,'stackoverflow.br','stackoverflow.pt') ,'stackoverflow.','')
  --,'meta.','')+'me' -- Some meta sites require this


SELECT
  Users.Id AS [User Link],
  Users.Reputation AS Reputation,
  COUNT(*) AS 'No. answers',
  SUM(CASE WHEN Posts.Score<##ScoreThreshold?0## THEN 1 ELSE 0 END)
  AS 'No. neg.',
  CAST(100*
    CAST( SUM(CASE WHEN Posts.Score<##ScoreThreshold?0## THEN 1 ELSE 0 END) AS FLOAT)
    /CAST( COUNT(*) AS FLOAT)
  AS NUMERIC(36,2)) AS '% negative score',
  'http://data.stackexchange.com/'+@site+'/query/393837?UserId='+CAST(Users.Id AS varchar)+'#graph|Link' AS 'Answer score distribution'
FROM  Posts
INNER JOIN Users ON Posts.OwnerUserId=Users.Id
WHERE PostTypeId=2 --answers
  AND Users.Reputation >=##ReputationThreshold?1000##
GROUP BY Users.Id, Users.Reputation
  HAVING COUNT(*)>##NoAnswersThreshold?10##
ORDER BY '% negative score' DESC

 -- ScoreThreshold: Count questions below score:
 -- ReputationThreshold: Minimum user reputation:
 -- NoAnswersThreshold: Minimum number of answers by user:

Enter Parameters

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