12

In the activity page we can see the Votes Cast by each type:

enter image description here

And within the closure tab we will have all the questions we voted to close regardless the reason of the closure (too broad, duplicate, etc).

I was wondering if there is any way to be able to filter these questions in order to find "how many question I voted to close as duplicate" or "how many question I voted to close as too broad"?

I know there isn't a specific need to have such feature within our activity page so this not a feature request. It's more about checking if there is some ways to get more precise stats about our own Closure Votes.

5
  • 2
    @SamuelLiew I was avoiding this as feature request :) I don't want this to be added to profile page[even if it can be good], but I was simply wondering if there is a way to have this information ... Commented May 21, 2018 at 0:09
  • 1
    I'm pretty sure even SEDE can't do this; the data just isn't there to see even what you voted to close. And nowhere does the site tell you what a given user (even yourself) actually selected as the close reason once closure has gone through. Commented May 21, 2018 at 1:16
  • @NathanTuggy even if it's a close as duplicate with the dupehammer? because when you do so, the information is there on the question saying that the gold bagde closed this question ... so maybe somehow we can get this one at least Commented May 21, 2018 at 1:26
  • Yeah, it might be possible to get that without scraping. Commented May 21, 2018 at 1:29
  • 1
    Hey, same question regarding the 7.5k pending close votes in review: it would be interesting to know the numbers per type.
    – Cœur
    Commented May 21, 2018 at 1:53

1 Answer 1

5

That data isn't readily available for others except yourself. Scraping those pages is your only option if you really need the level of detail you're looking for.

Nathan Tuggy mentioned SEDE but is right in their assessment that although some info does exist, details are limited. For example, the reviewtasks table doesn't have a userid, nor does votes.

The best you can have is looking at the PostHistory table and specially at the rows for PostHistoryTypeid = 10 which is a close event for a post. Once a post is closed that row fields comment and text are populated with the close reason and the close voters. The close voters are encoded in JSON format. With the latest SQL Server version parsing these fields has become much easier.

Here is a SEDE Query that, for the posts that have been closed and not deleted, show where you were one of the close voters, what the majority close reason was and if you closed due to using your hammer. Notice that both current and historic close reason are in the top row. I don't bother to re-map them to what we use today.

;with closevotes as
(
select 
       case crt.id 
       when 1 then 101
       when 2 then 102
       else crt.id
       end id
     , JSON_value(text, '$.Voters['+ value + '].Id') userid
     , JSON_value(text, '$.Voters['+ value + '].BindingReason.GoldTagBadge') hammertag
from posthistory ph
inner join closereasontypes crt on crt.id = comment
cross join string_split('0,1,2,3,4,5',',')
where ph.posthistorytypeid = 10 
and JSON_value(text, '$.Voters['+ value + '].Id') is not null
and JSON_value(text, '$.Voters['+ value + '].Id') = '##userid:int?8620333##'
)

SELECT hammertag,
      [101] [duplicate],                  
      [102] [off-topic],                  
      [103] [unclear what you're asking], 
      [104] [too broad],                  
      [105] [primarily opinion-based],
     
      [3] [not constructive],           
      [4] [not a real question],        
      [7] [too localized],              
      [10] [general reference],          
      [20] [noise of pointless]
FROM  
    (select id, userid, hammertag from closevotes)   
    AS source  
PIVOT  
(  
    count(userid)  
FOR   
id   
    IN ( [3], [4],[7],[10], [20], [101], [102], [103], [104], [105])  
) AS pivotdata

When run today this is what your result will look like:

table with hammer and count per close reason

Keep in mind SEDE is only updated once a week on Sunday morning. If you want to play with SEDE don't forget to have a look at the awesome tutorial

8
  • Thanks for this, indeed I was thinking that SEDE is the only way to hack around this. I guess it's a good time for me to get back to some SQL ;) Commented May 21, 2018 at 9:44
  • 2
    Shtop! hammertag!
    – TylerH
    Commented May 22, 2018 at 0:26
  • @TylerH I can't ! but I realize it's too much for only 249 days on the site :/ ... but all of them are legit ;) Commented May 22, 2018 at 15:13
  • Hi rene, a little question about SEDE. I am working on a query and relying on $.Voters like you did here. this array can contain from 1 to 5 elements, how I can I get the last element? I found something around the use of JSON_LENGTH to get the lenght then do a -1 but not working .. it's propably something really stupid... Commented Jan 27, 2019 at 10:32
  • @TemaniAfif JSON_Length is not a function TSQL supports at the moment. You can check for the JSON_VALUE being null as you have reached the last Id in that case. This query uses that trick: data.stackexchange.com/stackoverflow/query/971724
    – rene
    Commented Jan 27, 2019 at 10:54
  • ok thanks ... it's gonna be a little complicated, I tried to inlcude this in my query like so : data.stackexchange.com/stackoverflow/query/971770/… but nothing ... no easy all these nested select :/ Commented Jan 27, 2019 at 12:09
  • here you go: data.stackexchange.com/stackoverflow/query/971771/… @TemaniAfif
    – rene
    Commented Jan 27, 2019 at 12:16
  • ahh! was so close, forget the -1 .. thanks again. Commented Jan 27, 2019 at 12:20

You must log in to answer this question.

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