Percent Answered (in SE sites or '% Answered' in Area51 statistics)

0

Please login or register to vote for this query.

(click on this box to dismiss)

SITE HEALTH VALUE from Area51 statistics -> Percentage Answered (http://area51.stackexchange.com/proposals/42810/stack-overflow-in-spanish) --- Percent Answered in SE sites (http://stackexchange.com/sites#percentanswered) ---- Formula: %Answered = (Accepted + Answer_Has_Positive_Score + Closed) / Questions_Including_Closed ---- Source: http://meta.stackexchange.com/a/86976/304899

Stack Overflow en español

Preguntas y respuestas para programadores y profesionales de la informática

WITH Answers AS (
  -- unique answers with best score per question
  SELECT ParentId AS Id, MAX(Score) AS Score
  FROM Posts
  WHERE PostTypeId = 2
  GROUP BY ParentId
)
, Counts AS (
  SELECT
    -- Count for questions joined with answers
    datepart(YEAR, Q.CreationDate) Year,
    datepart(MONTH, Q.CreationDate) Mes,
    COUNT(*) AS Preguntas,
    SUM(IIF(Q.AcceptedAnswerId IS NOT NULL AND Q.ClosedDate IS NULL, 1, 0)) AS AcceptedNotClosed,
    SUM(IIF(Q.AcceptedAnswerId IS NULL AND A.Score > 0 AND Q.ClosedDate IS NULL, 1, 0))
      AS PositiveScoreNotAcceptedNotClosed,
    SUM(IIF(Q.ClosedDate IS NULL, 0, 1)) AS Closed
  FROM Posts Q
  LEFT OUTER JOIN Answers A
    ON Q.Id = A.Id
  WHERE Q.PostTypeId = 1
  group by datepart(year, Q.CreationDate), datepart(month, Q.CreationDate)
)
  
SELECT 
  Year, Mes, Preguntas, AcceptedNotClosed, PositiveScoreNotAcceptedNotClosed, Closed,
  (AcceptedNotClosed + PositiveScoreNotAcceptedNotClosed + Closed) AS Contestadas,
   
  CAST((AcceptedNotClosed + PositiveScoreNotAcceptedNotClosed + Closed) AS FLOAT) / 
     CAST(PREGUNTAS AS FLOAT) * 100
     AS Porcentaje
  
FROM Counts
ORDER BY Year, Mes

Enter Parameters

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