String format Exception in SSRS report

  • Hello,

    Can anyone correct the below ssrs expression

    =IIF(Fields!RedExceeds.Value Is Nothing, "", (Fields!RedExceeds.Value) * 100 / (Fields!MaxReducedAllowed.Value))

    If I have no value in Redexceeds column I am replacing with "" if there is value in Redexceeds it will give me percentage

    Now if I have value as 0 in RedExceeds and in maxreduced Allowed column ;actually 0 divides or multiplies by anything showing #Errror in ssrs

    How can I write the above expression if I don't have nay value in Redexceeds or if I have 0 value I need to replace with ""

    I tried the below expression but its still showing error

    =IIF(Fields!RedExceeds.Value=0 OR Fields!RedExceeds.value Is Nothing, "", (Fields!RedExceeds.Value) * 100 / (Fields!MaxReducedAllowed.Value))

  • The only thing that jumps out to me is that you are checking for 0 in RedExceeds and you are dividing by MaxReducedFieldAllowed so you might still be getting divide by 0 error. So you might want this expression:

    =IIF(IsNothing(Fields!RedExceeds.Value) OR Fields!MaxReducedAllowed.Value=0, "", (Fields!RedExceeds.Value) * 100 / (Fields!MaxReducedAllowed.Value))

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply