February 6, 2014 at 3:33 am
When I use calculation in generating reports, I get Nan,#Error,Infinity values in preview , I wanted to avoid this and display " " if the result of calculation is null or infinity..
Please let me know how to avoid "NaN" and "infinity" and "#Error", while displaying in reports.
when ever i see the prview NAN values are displayed and remaining fields are shows appropriate query results like percentage values Like 98%.00 some thing but i have a problem with "NaN" and "infinity" and "#Error" values i need to change those "NaN" and "infinity" and "#Error" values to " "
February 6, 2014 at 3:38 am
battula.ramu6 (2/6/2014)
When I use calculation in generating reports, I get Nan,#Error,Infinity values in preview , I wanted to avoid this and display " " if the result of calculation is null or infinity..Please let me know how to avoid "NaN" and "infinity" and "#Error", while displaying in reports.
when ever i see the prview NAN values are displayed and remaining fields are shows appropriate query results like percentage values Like 98%.00 some thing but i have a problem with "NaN" and "infinity" and "#Error" values i need to change those "NaN" and "infinity" and "#Error" values to " "
Use IsNull(value,'') to handle NULLs.
'Infinity' is not defined (or returned) in T-SQL - can you give an example of a calculation that returns this result?
If you are looking for a pure SSRS solution (rather than T-SQL), you might do better if you post in one of the dedicated Reporting Services forums.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
February 6, 2014 at 1:19 pm
In percentage calculations, often you get these errors showing because of divide by zero/null issues. Adding expressions like the following can take care of it (vary depending on what your percentage calculation is).
for null:
=IIF(Fields!Denominator.Value Is Nothing, "", (Fields!Numerator.Value - Fields!Denominator.Value) / Fields!Denominator.Value)
For zero:
=IIF(Fields!Denominator.Value = 0, "", (Fields!Numerator.Value - Fields!Denominator.Value) / Fields!Denominator.Value)
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply