trending tags by week

0

Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

WITH p as (SELECT *, (CASE WHEN (Tags LIKE '%community%')
                           THEN 'community' 
                           ELSE 'other questions' 
                       END
                   ) AS tagtype 
            FROM PostsWithDeleted
           )
SELECT 
  1.000*datepart(year,p.CreationDate)+1.000*datepart(week,p.CreationDate)/52 as [date],
  tagtype,
  count(Id)
FROM p
WHERE 
  PostTypeId = 1 AND 
  CreationDate BETWEEN '2017'+'-02-01' AND '2019'+'-10-27'
GROUP BY 
  1.000*datepart(year,CreationDate)+1.000*datepart(week,CreationDate)/52,
  tagtype
ORDER BY 
  1.000*datepart(year,CreationDate)+1.000*datepart(week,CreationDate)/52,
  tagtype

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results