5

Now that efforts are underway to reward duplicate finders, how may we find out how much duplicates we have successfully closed/close-voted so far?

I've tried this solution, but it doesn't seem to work (anymore):

enter image description here

4
  • What is wrong with it?
    – rene
    Commented Jun 1, 2020 at 7:18
  • @rene It shows just zero (see added screenshot), but I found a few more.
    – jay.sf
    Commented Jun 1, 2020 at 7:21
  • 4
    Okay, I found the issue, the close reasons got an overhaul and that query doesn't handle that nicely. Working on a fix now
    – rene
    Commented Jun 1, 2020 at 7:32
  • 1
    another generic query that gives stat of all users: data.stackexchange.com/stackoverflow/query/1237407/… .. you can easily update to get only your stat by adding a simple where hc.UserId = .. Commented Jun 1, 2020 at 8:03

1 Answer 1

12

Here is the query that shows you how often you found a duplicate that lead to the actual closure of the question with that reason. This only counts non-deleted posts and doesn't take re-openings into account. The count is split between "normal" duplicates and duplicates where you "hammered" a question due to a gold badge you own.

The PostHistory table in SEDE records in rows with PostHistoryTypeid = 10 the close event of a question. In the text column a JSON object is stored that holds the questionid and the close voters. With the SQL function JSON_Value you can parse and select properties out of that JSON text. Given there are in theory at most 5 close voters (but some cases exist where 6 or even 7 close voters are found) we can cross join with a set of numbers from 1 till 7 to get the individual close vote userid's.

select hammertag
     , count(*) [#duplicates]
from
(
select JSON_value(text, concat(N'$.Voters[', value, N'].Id')) userid
     , JSON_value(text, concat(N'$.Voters[', value, '].BindingReason.GoldTagBadge')) hammertag
from posthistory ph
cross join string_split(N'0,1,2,3,4,5,6,7',',')
where ph.posthistorytypeid = 10 -- closed 
and comment in (1,101) -- duplicate close reasons
and JSON_value(text, concat(N'$.Voters[', value, N'].Id')) = '##userid:int?6574038##'
) data
group by hammertag

When run today, this is the result for your account:

sede result showing 78 regular duplicates and 10 dupe-hammer duplicates in the R tag

Keep in mind SEDE is updated once a week on Sunday.
Give a big shout-out to Monica Cellio for the awesome SEDE Tutorial she wrote.
Say "Hi" in SEDE chat.

8
  • why your query is giving me more than 4000 while this one (data.stackexchange.com/stackoverflow/query/1237407/…) is giving me around 3700 ? Commented Jun 1, 2020 at 8:09
  • @TemaniAfif that query only looks at the new close reason (ids > 100) My query also takes the previous close reasons into account. Id's 1 and 101 are the ones to be taken into account.
    – rene
    Commented Jun 1, 2020 at 8:16
  • an idea when the change from old to new was made? I guess I was not yet here because I don't remember seeing close reasons like Too localized Commented Jun 1, 2020 at 8:25
  • @TemaniAfif 6 to 8 years ago meta.stackexchange.com/questions/184154/…
    – rene
    Commented Jun 1, 2020 at 8:37
  • @rene Do that query work correctly given that mods have a built in hammer? Commented Jun 1, 2020 at 12:48
  • @DavidPostill it will record that you dupe voted having a goldbadge. The bindingreason is there. When you dupe vote "regular" questions it isn't indicated you did so as mod. I can tell you are a mod due to you being the only close voter but that is about it.
    – rene
    Commented Jun 1, 2020 at 15:36
  • @DavidPostill here is a query that is the best I can do to show a diamond vote, regular vote or tag gold badge vote: data.stackexchange.com/superuser/query/1245928?UserId=337631
    – rene
    Commented Jun 1, 2020 at 16:28
  • Neat. Thanks... total matches as well :) Commented Jun 1, 2020 at 16:32

You must log in to answer this question.

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