none
SUM WITH IIF - new RRS feed

  • General discussion

  • Hello,

    I need to evaluate a char field  and if it's equal a "F" ie. I need to sum a numeric field
    like this:

    =IIF(Fields!CUPOFC.Value = "F",SUM(Fields!INTPLTD.Value),1)

    I need to check if the field CUPOF = "F" if it is I need to sum the field INTPLTD

    at the end of the report it will look like this:

    coupon F total =  xxxxx.xx
    coupon Z total = xxxxx.xx
    coupon L total = xxxxx.xx

    but the command above is not working, help please
    thanks

    Wednesday, August 13, 2008 12:50 PM

All replies

  • Describe what you mean by not working?

    Are  you getting  "#error"

    or are you getting a value, just the wrong value?
    Living my life at 123mph in 11.15 seconds
    Wednesday, August 13, 2008 3:57 PM
  • i'm getting the wrong value
    Wednesday, August 13, 2008 4:30 PM
  • ok, well first off, remember the sum function will default to a certain scope unless specified otherwise

    So I'm going to assume you've got this in like a table footer, or group footer.

    =SUM(IIF(Fields!CupOFC.Value="F",Fields!INTPLTD.Value,0))


    I think this should work.... I have no way to test it though


    Living my life at 123mph in 11.15 seconds
    Wednesday, August 13, 2008 6:58 PM