Question Count or Score growth over time by tag comparison

0

Please login or register to vote for this query.

(click on this box to dismiss)

Plots total questions over time or total score over time, comparing up to 4 tags. Reference: http://meta.stackoverflow.com/q/260570/331508

Joomla

Q&A for Joomla! administrators, users, developers and designers

-- ShowScore: Enter 1 for scores, 0 for question counts
-- Tag1: Tag name (lowercase) or 'NA' (uppercase) "Enter a tag name or uppercase NA or a single space"
-- Tag2: Tag name (lowercase) or 'NA' (uppercase) "Enter a tag name or uppercase NA or a single space"
-- Tag3: Tag name (lowercase) or 'NA' (uppercase) "Enter a tag name or uppercase NA or a single space"
-- Tag4: Tag name (lowercase) or 'NA' (uppercase) "Enter a tag name or uppercase NA or a single space"
-- Tag5: Tag name (lowercase) or 'NA' (uppercase) "Enter a tag name or uppercase NA or a single space"
-- Tag6: Tag name (lowercase) or 'NA' (uppercase) "Enter a tag name or uppercase NA or a single space"
DECLARE @ShowScore INT      = ##ShowScore:int##;
DECLARE @Tag1 varchar(255)  = ##Tag1:string##;

    SELECT      DATEADD (month, DATEDIFF (month, 0, q.CreationDate), 0)  AS [Month],
    
    COUNT (q.Id)                AS NumQuests

    FROM        Posts           q
    INNER JOIN  PostTags        pt
    ON          q.Id            = pt.PostId
    INNER JOIN  Tags            t
    ON          t.Id            = pt.TagId

    WHERE       q.PostTypeId    = 1
    AND         q.CreationDate >= '2016-01-01 00:00:00'
    AND         t.TagName       IN (@Tag1)

    GROUP BY    DATEADD (month, DATEDIFF (month, 0, q.CreationDate), 0),
                t.TagName

Enter Parameters

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