Distribution of the number of review actions on close review tasks that were invalidated


Please login or register to vote for this query.

(click on this box to dismiss)

Linguistics Meta

Q&A about the site for professional linguists and others with an interest in linguistic research and theory

declare @epoch as datetime = DATEADD(WEEK, - ##Weeks:int?52## - 1, CURRENT_TIMESTAMP);

select coalesce(total, 0) as '# Of Review Actions', 
       count(t.Id) as 'Count', 
       count(t.Id) * 100.0 / sum(count(*)) over () as 'Percent'
from ReviewTasks t
left outer join (
  select count(r.ReviewTaskId) as total, r.ReviewTaskId 
  from ReviewTaskResults r group by r.ReviewTaskId
  as counts
  on t.Id = counts.ReviewTaskId 
where t.ReviewTaskTypeId = 2 -- Close
and t.ReviewTaskStateId = 3 -- Invalid
and t.CreationDate > @epoch
group by total
order by '# Of Review Actions';

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results