SSRS Calculations
I have SP which returns Companyname, years, sales columns from database.
Example :
CompanyA 2005 1000
CompanyA 2006 100
CompanyA 2007 500
Like wise for 10 different companies and 4 different years.
I am using matrix in SSRS to show the data.
I need to show data like this
Company Name 2006 2007 2008 [sales percentage increase(06-07)] [sales percentage increase(07-08)]
So i need to get value from the previous column group and do the calculations. I can do this in SP but there are 10 different calculation and need to do these on the fly. Please suggest a way to do it.
Please help.....
February 25th, 2011 2:25pm
Hi Gani.yadav,
Based on your information, I think we could achieve this requirement in Reporting services, please follow these steps:
1. Add a matrix to the report body, then drag CompanyName to row group, Year to column group, Sales to data textbox.
2. Right-click the second column, and then select Insert Column, then click OutGroup-Right to insert two columns for [sales percentage increase(06-07)]
and [sales percentage increase(07-08)]
3. Type in the expression for first column created in step two =(SUM(IIF(Fields!Year.Value=2007,Fields!Sales .Value,0))-SUM(IIF(Fields!Year.Value=2006,Fields!Sales
.Value,0)))/SUM(IIF(Fields!Year.Value=2006,Fields!Sales .Value,0))
4. Type in the expression for second column created in step two =(SUM(IIF(Fields!Year.Value=2008,Fields!Sales .Value,0))-SUM(IIF(Fields!Year.Value=2007,Fields!Sales
.Value,0)))/SUM(IIF(Fields!Year.Value=2007,Fields!Sales .Value,0))
Then you could get sales percentage increase.
Thanks,
Challen Fu
Challen Fu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
March 1st, 2011 10:12pm