Selective Count in Reporting Services Report field

  • I am using SQL 2005 reporting services.

    I have a report that displays a number of records. One of the fields returned is yes or no. I would like to display the count of yes in one text box and the percentage of yes fields returned in another text box. I think there is a way to do this using an iff statement, but I can't get it to work.

    I am pretty new to the SQL reporting services, if anyone can offer some help, it would be greatly appreciated.

  • I found one possible solution to my issues as shown below:

    =sum(iif(fields!InSpec.Value ="Yes",0,1))

    and for the percentage

    =sum(iif(fields!InSpec.Value ="Yes",1,0))/count(fields!InSpec.Value)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply