8

Are there any stats about the percentage of close reasons used to close questions

  • Successfully (preferably, based on the number of closed questions)
  • Unsuccessfully (alternatively, the total percentags of close votes cast by users)

?

Is there any way to get this from the query explorer?

4
  • Probably not from SEDE, as close votes expire.
    – waiwai933
    Jan 9, 2011 at 11:35
  • @waiwai ah, true. Hadn't thought of that. @Developers, is there a chance of getting that info? (Just if it isn't too much trouble, I'm just looking for background info for a feature suggestion)
    – Pekka
    Jan 9, 2011 at 11:36
  • Just in case somebody stumbles over this like me: be aware that off-topic/community specific reasons are not differentiated further in the data explorer. See Please add the individual close-as-off-topic reason in the Data Explorer for a feature request. Mar 9, 2021 at 14:53
  • I think that New 10K tool: question close statistics (from way back in 2015) sort of accomplishes what this request was looking for, right? (If so, should this be tagged as [status-completed]?)
    – V2Blast
    Feb 9, 2023 at 3:07

2 Answers 2

9

Unsuccessfully -- no, when close votes disappear from the system, they are hard-deleted, so they physically don't exist anymore (except in backups, I suppose).

Successfully -- yes, the CloseReasonId is actually stuffed into the Comment field in PostHistory (I've updated the docs to reflect this). I created a query to summarize how frequently questions are closed by type of close. You can calculate the percentages from this quite easily.

Also, for the curious, I created another query to show how you have voted to close in successfully closed questions.

4
  • Sweet, exactly what I was looking for (well, minus the "Unsuccessfully" part, but I kind of expected that). Thank you very much!
    – Pekka
    Jan 9, 2011 at 19:41
  • @Pekka: You're welcome! I was curious why there was no CloseReasonId column in PostHistory, so it was good to figure this out.
    – Jon Seigel
    Jan 9, 2011 at 19:45
  • @Jon, where is the vote close reason stored? Nothing makes it to the history table unless the post is closed. This info, however, must get stored somewhere. The most common close reason is noted if more than one reason is used. Does the votes table have extra columns not visible on SEDE? Like a closeReasonId or something?
    – Mohamad
    Aug 11, 2011 at 3:16
5

As the CloseReason are now part of SEDE I've created queries that use those tables:

Here is the close statistics for non-deleted posts

select case 
       when crt.id in (1,101) then 'duplicate' 
       when crt.id in (2,102) then 'off topic'
       else crt.name
       end as [name]
       , count(ph.id) as [count]
from posthistory ph
inner join CloseReasonTypes crt 
        on crt.id = cast(ph.comment as int)
where posthistorytypeid = 10
group by case 
       when crt.id in (1,101) then 'duplicate' 
       when crt.id in (2,102) then 'off topic'
       else crt.name
       end 

Here I combined the two separate duplicate and off topic close reasons into one, based on @ShadowWizards comment. In the next query I leave that out so you can see if the change of reasons and the subtle new guidance that came with their introduction made a difference for you.

And this one shows your own favourite close reasons:

select crt.name
     , count(ph.id) as [count]
from posthistory ph
inner join CloseReasonTypes crt 
        on crt.id = cast(ph.comment as int)
where posthistorytypeid = 10
and   text like '%"Id":' + ##Userid:string## + ',%'
group by crt.name

Final note: SEDE is update once a week and doesn't hold deleted posts.

5
  • Nice! However, two bugs: i.stack.imgur.com/BAdSP.png can those reasons be merged? Dec 21, 2014 at 13:04
  • But aren't they technically different reasons, also with slightly different characteristics?
    – rene
    Dec 21, 2014 at 13:05
  • Looks like the close reason name was simply changed over time, no? Dec 21, 2014 at 13:09
  • No, yes, maybe. Anyway... a compromise, is this fine?
    – rene
    Dec 21, 2014 at 13:41
  • Perfect! Already got my +1 but I would have given another one ;) Dec 21, 2014 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .