Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Remove Nan in % column

Author  Topic 

jbrown7232
Starting Member

22 Posts

Posted - 2011-03-16 : 13:31:03
I have created a report, but i notice that i get 'NaN' and 'Infinity' in my % column

how do i remove this from view, i.e. to return a blank field

below is the formula used to populate the % column

=Sum(Fields!SessionsComplete.Value)/Sum(Fields!SessionsStarted.Value)

gavakie
Posting Yak Master

221 Posts

Posted - 2011-04-11 : 17:07:02
use and iif statement setting it to blank. =iif(Sum(Fields!SessionsStarted.Value) = 0," ", Sum(Fields!SessionsStarted.Value))
Go to Top of Page

ssrstips.com
Starting Member

5 Posts

Posted - 2011-04-12 : 03:02:34
Is it possible one of your SUMs is 0? If so, then instead of doing risky divides like this, use Code.Divide(Sum(Fields!SessionsComplete.Value), Sum(Fields!SessionsStarted.Value))

And a custom code of:
Public Share Function Divide(value1 As Double, value2 As Double) As Double
If value2 = 0 Then
Return ""
Else
Return value1 / value2
End If
End Function
Go to Top of Page
   

- Advertisement -