Comparison of months in SSRS

  • Hi everyone

    I wonder if someone can help.

    I have a very basic SSRS Matrix report that shows Sales by Store for the year. So in other words the report comprises of the following: Row Groups: Fields!Store.Value, column groups: Fields!SaleDate.Value and the report detail shows the Fields!Sales.Value.

    What I want to do is compare the current month with the previous month and if sales are higher or lower then highlight this in the background color of the report ie if sales in December were higher than November then color the background in green otherwise color the background in red.

    Is this possible or would I need to do something in the SQL before bringing it into SSRS?

    Thanks in advance.

    BO

  • I would do it in the SQL - join the table to itself on month -1 & then you can make the comparison

  • Cheers Laurie

    I guess it's always better to do these things in T-SQL rather than SSRS.

    BO

  • Using t-sql filter the month

    SELECT *

    FROM tableName

    WHERE month(date2) = month(getdate())

  • Thanks John - got the report working the way I want it to.

    BO

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply