Click here to monitor SSC

SSRS 2005 - Column Grouping and displaying their variances

Last post 06-22-2010, 11:35 PM by brown. 2 replies.
Sort Posts: Previous Next
  •  05-06-2009, 4:12 AM Post number 73364

    SSRS 2005 - Column Grouping and displaying their variances

    Dataset:Select ProductName, right(convert(varchar(11), billdate, 106), 8) As Period, sum(sale) as TotalSale from Product Group By ProductName, right(convert(varchar(11), billdate, 106), 8)

    Output:
     Product                Period                  Sale

    Sugar                     Jan-08                   1000
    Sugar                     Feb-08                  2000
    Sugar                     Jan-09                   2000
    Sugar                     Feb-09                  4000
    Butter                     Jan-08                   500
    Butter                      Feb-08                  300
    Butter                    Jan-09                   1000
    Butter                      Feb-09                  600

     How can I get the variance and % variance of last month’s figure and last year same month figures?

    Desired Result:
    Product                  Periods                                 Month Var Month% Var LastYr var   LastYr%Var

                             Jan-08 Jan-09 Feb-09 Feb-09

    Sugar               1000    2000   2000       4000   2000          100%           1000                     100%

    Thanks

    Shekhar

  •  05-08-2009, 10:38 AM Post number 73390 in reply to post number 73364

    • Arles is not online. Last active: 02-23-2011, 7:26 AM Arles
    • Top 25 Contributor
    • Joined on 10-20-2008
    • Nashville, TN
    • Celeron 450

    Re: SSRS 2005 - Column Grouping and displaying their variances

    Here's an excellent article by David Leibowitz addressing what you need:

       http://www.simple-talk.com/sql/sql-server-2005/advanced-matrix-reporting-techniques/

  •  06-22-2010, 11:35 PM Post number 93185 in reply to post number 73364

    • brown is not online. Last active: 06-22-2010, 11:39 PM brown
    • Top 500 Contributor
    • Joined on 06-22-2010
    • Level 1: Deep thought

    Re: SSRS 2005 - Column Grouping and displaying their variances

    Dear i really want this kind of site.It is very handy and accommodating post.
View as RSS news feed in XML