Site Activity and VoteGraph

53

Please login or register to vote for this query.

(click on this box to dismiss)

Plot the site activity by voting, questions, answers and comments, aggregated per week.

Writing Meta

Q&A about the site for the craft of professional writing, including fiction, non-fiction, technical, scholarly, and commercial writing

with Voting as (
    select v.CreationDate as YearMon,
      --DATEFROMPARTS(DATEPART(Year, v.CreationDate),
      --                   DatePart(Month, v.CreationDate),
      --                   1) as YearMon,
       case when p.PostTypeId = 1 then 'Q' else 'A' end + vt.Name as Series,
       1 as Vote
    from Posts p,
         Votes v,
         VoteTypes vt
    where p.Id = v.PostId
      and v.VoteTypeId = vt.Id
    -- group by YearMon, Series
)
select *
-- YearMon, Series, Count(Vote) as Votes
from Voting
pivot (
    sum(Vote)
    for Series in ([QUpMod],[QDownMod],[QFavorite],[AUpMod],[ADownMod],[AAcceptedByOriginator]))
    as Pivoted
where YearMon >= '2011-01-01'
order by YearMon   
    --group by YearMon, Series

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results