suppose i have the following Report:
Code, Year, Jan, Febr, March.... December, Total
ABC 2011 13 883 2828 .... 3000
ABC 2012 20 888 ....
XYZ 2011 ....
XYZ 2012 ....
I need to insert a “delta row” each 2 row (2 year) per code to have my report
Code, Year, Jan, Febr, March.... December, Total
ABC 2011 13 883 2828 .... 3000
ABC 2012 20 888 ....
Delta +7 +5 ....
XYZ 2011 ....
XYZ 2012 ....
Delta ....
How to do this with Sql Server Reporting Services ?
Thank you
One method to get this is:
=IIF(Previous(Fields!Code.Value,"RowGroupNameGoesHere") = Fields!Code.Value , false, true )[I know, redundant to have IIF to return true or false, but it makes troubleshooting easier and more flexible.]
=SUM(Fields.QuantitySold.Value) - Previous(Sum(Fields!QuantitySold.Value),"RowGroupNameGoesHere")[I’m assuming you are pivoting with a tablix, and that your dataset doesn’t have a different column for each month. If it does, then the same approach will work, but uses the appropriate field names, without SUM, in the formula in step 3.
This will generate a difference row for every row in the report, but then hide the ones that are between matching elements.