Answer rate for selected tag by year

0

Please login or register to vote for this query.

(click on this box to dismiss)

History of Science and Math

Q&A for people interested in the history and origins of science and mathematics

SELECT year(Posts.CreationDate) AS Year, Count(*) as 'Question Count',
coalesce(count(case when AnswerCount > 0 then 0 end), 0) as 'Answered', 
-- coalesce(count(case when AnswerCount > 0 then 0 end)*100/count(*), 0) as 'Answer Rate', 
coalesce(count(case when ClosedDate is not null then 1 end), 0) as 'Closed'
-- coalesce(count(case when ClosedDate != 0 then 1 end)*100/count(*), 0) as 'Closure Rate' 
FROM Tags
JOIN PostTags on Tags.Id = PostTags.TagId 
JOIN Posts on Posts.Id = PostId
WHERE PostTypeId = 1
AND TagName = ##SelectedTag:string?google-sheets##
AND year(Posts.CreationDate) >= 2010
AND year(Posts.CreationDate) < year(GETDATE())
GROUP BY TagName, year(Posts.CreationDate)
ORDER BY year(Posts.CreationDate) ASC, Count(*) DESC

Enter Parameters

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