0

I have values in a column (col 3) in ssrs report which is a calculation of two other columns. The calculation is col3 = col1/col2 where i set col3 to nothing if col2 is 0. e.g. iif(col2 = 0,nothing,col1/col2) However the col3 should show blank values in report but it shows 0. The format of col3 is given as "#,0.0%;(#,0.0%)" Is There any way to display the values as blank when col2 is 0 ?

nidhi
  • 21
  • 4
  • Looks like this is the likely solution. http://stackoverflow.com/questions/14606390/detecting-null-dates-and-showing-empty-string-in-ssrs – GregHNZ Oct 20 '15 at 06:45
  • Are you sure this is a problem when col2 is zero? [`IIF` doesn't short circuit in SSRS](http://stackoverflow.com/q/1204179/1657324), so a zero there should be giving you divide by zero errors. – stubaker Oct 20 '15 at 18:41

1 Answers1

0

Yup i found the solution..The solution was not in the syntax but in the format in which i put the solution in expression dialogue box of ssrs.

Initially my solution was :

= iif(col2 = 0,nothing, +   
col1/col2) 

Later I changed my solution to :

= iif(col2 = 0,nothing,col1/col2) 

It worked !

Oceans
  • 3,445
  • 2
  • 17
  • 38
nidhi
  • 21
  • 4