Link to home
Start Free TrialLog in
Avatar of ITCity
ITCity

asked on

Calculated field in SSRS

I have a calculated field with the following formula
projection=(a*12/b)/C

There are cases where the value of C is 0; so when you preview the report, it shows #Error for those record where C=0
I don't want to have #Error for the projection value. Is there any way to validate that? I would like to show 0 instead of #Error
Avatar of Jarrod
Jarrod
Flag of South Africa image

Try:
projection=IIf(C>0, (a*12/b)/C, 0)

Open in new window

Avatar of Aneesh
projection= case when c>0 then (a*12/b)/C else null end
ASKER CERTIFIED SOLUTION
Avatar of ITCity
ITCity

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
try:


  	

projection=IIf(C>0 and b>0, (a*12/b)/C, 0)

Open in new window