0

In SSRS, how would I sum a column that gets it's value from an expression? For example...

Field1  |  Field2  |  Computed Field
------  |  ------  |  --------------
10      |  20      |  100 *IIF(Fields!Field1.Value > Fields!Field2.Value, 0, 100)*
40      |  20      |  0   *IIF(Fields!Field1.Value > Fields!Field2.Value, 0, 100)*
50      |  20      |  0   *IIF(Fields!Field1.Value > Fields!Field2.Value, 0, 100)*
------     ------     ---------------------
                      HOW DO I GET THETOTAL?
                      OF THIS COMPUTED FIELD

Things I've tried:

  • Using "Add Total" in the report designer, but it is greyed out.
  • Using conversion expression to convert IIF result to a numeric value, but summing the column give me an error.

Thanks in advance for any help you can give!

bigtri
  • 5
  • 2

1 Answers1

0

You need to sum your expression and reference your dataset, for example:

=sum(IIF(Fields!Field1.Value > Fields!Field2.Value, 0, 100),"DataSet1")

Pete Rennard-Cumming
  • 1,588
  • 10
  • 19
SuperSimmer 44
  • 964
  • 2
  • 7
  • 12