all groups > sql server reporting services > august 2005 >
You're in the

sql server reporting services

group:

Count Null Values


Count Null Values C a r l o s - A n t o n i o
8/17/2005 4:15:54 PM
sql server reporting services: Hi

How do I count Null and non null values in reporting services....????

Thanks

Carlos Antonio

Re: Count Null Values Robert Bruckner [MSFT]
8/17/2005 6:46:09 PM
This will count all rows where the value of the X-field is not null:
=Count(Fields!X.Value)

You may also want to check the CountDistinct(...) aggregate function.

-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

Re: Count Null Values Lance
8/23/2005 10:17:23 AM
You can also do counts via the SUM function with a nested IIF like
this:

// This counts NOT NULL values
=SUM(IIF(Fields!MyField.Value = Nothing, 1, 0))

// This counts NULL values
=SUM(IIF(Fields!MyField.Value = Nothing, 0, 1))

Lance
http://www.lance-hunt.net
Re: Count Null Values Lance
8/23/2005 10:39:10 AM
Sorry, my comments are backwards....

// This counts NULL values
=SUM(IIF(Fields!MyField.Value = Nothing, 1, 0))

// This counts NOT NULL values
=SUM(IIF(Fields!MyField.Value = Nothing, 0, 1))
AddThis Social Bookmark Button