Porcentaje de Preguntas Contestadas (en sitios SE o el indicador '% Answered' del Area51)

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 Respuestas AS (
  -- Respuestas con votos positivos
  SELECT ParentId AS Id, MAX(Score) AS Votos
  FROM Posts
  WHERE PostTypeId = 2
  GROUP BY ParentId
)
, Conteo AS (
  SELECT
    -- Contar las preguntas con las respuestas
    datepart(YEAR, P.CreationDate) Anio,
    datepart(MONTH, P.CreationDate) Mes,
    COUNT(*) AS Preguntas,
    SUM(IIF(P.AcceptedAnswerId IS NOT NULL AND P.ClosedDate IS NULL, 1, 0)) AS AceptadaNoCerrada,
    SUM(IIF(P.AcceptedAnswerId IS NULL AND R.Votos > 0 AND P.ClosedDate IS NULL, 1, 0))
      AS RespuestaConVotosPositivosSinAceptar_PreguntaSinCerrar,
    SUM(IIF(P.ClosedDate IS NULL, 0, 1)) AS Cerrada
  FROM Posts P
  LEFT OUTER JOIN Respuestas R
    ON P.Id = R.Id
  WHERE P.PostTypeId = 1
  group by datepart(year, P.CreationDate), datepart(month, P.CreationDate)
)
  
SELECT 
  Anio, Mes, Preguntas, AceptadaNoCerrada, RespuestaConVotosPositivosSinAceptar_PreguntaSinCerrar, Cerrada,
  (AceptadaNoCerrada + RespuestaConVotosPositivosSinAceptar_PreguntaSinCerrar + Cerrada) AS Contestadas,
  (Preguntas - (AceptadaNoCerrada + RespuestaConVotosPositivosSinAceptar_PreguntaSinCerrar + Cerrada)) AS Diferencia,
    CAST((AceptadaNoCerrada + RespuestaConVotosPositivosSinAceptar_PreguntaSinCerrar + Cerrada) AS FLOAT) / 
    CAST(PREGUNTAS AS FLOAT) * 100
      AS Porcentaje
  
FROM Conteo
ORDER BY Anio, Mes

Enter Parameters

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