Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count records with Null values

Status
Not open for further replies.

mchambers

MIS
Aug 28, 2008
56
US
Hello,

I am creating a report that shows all staff productivity for each individual day of the week there are some staff who show a zero on some days and I can’t get the grand total at the end to count the staff Member if productivity is zero. Any help is appreciated. Here is the expression I am using.
=sum(Fields!Duration.Value) / (count(Fields!v_PROVIDER_NAME.Value) *8)

Thanks
 
The general way to 'count' values that are null is by using a case statement

I.e., sum(Case when field is NULL then 1 else 0 end)

I hope this helps.
 
Thank you for your response. How would I do this in SSRS under the expression? Sorry new to SSRS. I have attached my sample data and groupings.
Productivity_zuzhve.jpg
ProductivityGroup_d1oejv.jpg
 
If I recall correctly it would be something like this. =SUM(iif(ISNOTHING(FIELD),1,0)
 
I change it to =sum(iif(isnothing(Fields!Duration.Value),1,0)) / (count(Fields!v_PROVIDER_NAME.Value) *8)
and all zeros came back.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top