views:

434

answers:

2

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
+1  A: 

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).

David Wimbush
Thanks but that would not work because there are no fields called "License" or "Registration." The fields in the DataSet are "FeeDescription" and "FeeValue." "License" and "Registration" are part of the data returned that I would like to include in the calculation.
KenB
see, tha'ts something important that would have been useful in the origional post
DForck42
A: 

something like this should work

=sum(iif(Fields!FeeDescription="License" or Fields!FeeDescription="Registration",Fields!FeeValue,0))
DForck42