SQLTeam.com | Weblogs | Forums

NaN Value in SSRS


#1

I have some cells that are coming up with the NaN value. The funtion that I am using that is making this value is:

=CDBL(reportitems!Textbox33.Value) / CDBL(reportitems!Textbox103.Value)

It's basically taking two text boxes and making them into a percent. It only happens when the two text boxes equal 0. Any way to get this NaN to convert to 0.00 ?

Thanks Guys And Gals :smile:


#2

try this

=replace(round(CDBL(reportitems!Textbox33.Value) / CDBL(reportitems!Textbox103.Value),2),"NaN","0")


#3

That worked great. The only issue now it that the format of the cell is coming out in decimal form. I changed the textbox properties to make it a percentage, but it's still coming up as 0.22 not 22%

Is there another way to make it into a percent?


#4

click the value text box and in the property window in the Format field type in "P0" as in (letter P and number "Zero") that should do the trick


#5

if the P0 didn't work for you then use this instead

=replace(round(((CDBL(reportitems!Textbox33.Value) / CDBL(reportitems!Textbox103.Value))*100),2),"NaN","0")+"%"


#6

Brilliant. Thanks for your assistance :smile: