Sql – Reporting Services 2005 Subtract 2 Values in a Table

asp.netreporting-servicesreportingservices-2005sql server

I have a list of fees being displayed in a table object. I would like to display the difference between 2 of the fees in a text box (not sure if this goes in the table footer or in a group footer). I am able to sum values easy but I don't see how I can subtract values. In this example let's say I would like to show the difference of the License fee and Registration fee (999-333). How can I do this using groups / filters etc? BTW I want to do this at the report level not in a stored procedure! Thanks in advance…

This is what the data out put looks like:

FeeDescription    FeeValue
License           $999.00 
Registration      $333.00 
Inspection        $444.00 
Title             $555.00 
Tire Fee          $5.00 
Battery Fee       $1.50 
MVWEA (Lemon Law) $2.00 

Best Answer

I'm guessing you're using a table. So you can do the calculation with an expression in the relevant cell's Value property. For an item-level row: =Fields!License.Value - Fields!Registration.Value. For a group-level row: =sum(Fields!License.Value - Fields!Registration.Value).