Distribution of score aquired as function of age for questions and answers


Please login or register to vote for this query.

(click on this box to dismiss)

Sitecore Meta

Q&A about the site for developers and end users of the Sitecore CMS and multichannel marketing software

With a as
   DATEPART(YYYY, p.CreationDate) TimeYr, 
   case when VoteTypeId = 2 then 1.00 
        when VoteTypeId = 3 then -1.00 else 0.00 end VoteS,
   DATEDIFF(day, p.CreationDate, v.CreationDate) delay
   from Votes v join Posts p 
                on p.Id = v.PostId 
   where p.PostTypeId in (1)
     and v.VoteTypeId in (2,3)
     and DATEPART(YYYY, p.CreationDate) in (2010, 2012, 2014, 2016)
), c as 
   Select DATEPART(YYYY, CreationDate) TimeYr,
          count(Id) nyear from Posts
   where PostTypeId = 1 
   group by DATEPART(YYYY, CreationDate)
), d as
     round(1.00*delay/30,0) mdelay, 
     SUM(VoteS) sumscore
   from a
   where PostTypeId = 1 
   group by round(1.00*delay/30, 0), TimeYr

d.mdelay, CAST(d.TimeYr as Char), log(d.sumscore/c.nyear,10)
from d join c on d.TimeYr = c.TimeYr
where d.mdelay <= 36
order by d.TimeYr, d.mdelay

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results