Solved

How to do a disctinct count of null values?

Posted on 2012-04-04
2
341 Views
Last Modified: 2012-04-04
How to do a disctinct count of null values?

I have a report that I need the distince count of employee numbers, but I need to exclude the null values (as they are not to be included int a given category).



Thank you very much.
0
Comment
Question by:kgittinger
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
Comment Utility
It sounds like you want to get this count at group level.
So create a formula field for the group header...

WhilePrintingrecords;
Numbervar nullKnt:=0;
""

In the detail line add formula field..

WhilePrintingrecords;
Numbervar nullKnt;
if isnull(table.employee}) then nullKnt:=1;
""

In the group  footer;

WhilePrintingrecords;
Numbervar nullKnt;
distinctCount({Table.Employee}, {table.groupfield}) - nullKnt
0
 
LVL 7

Expert Comment

by:waltersnowslinarnold
Comment Utility
This sample query could well assist you;

SELECT SUM(CASE WHEN col IS NULL THEN 1 ELSE 0 END) NullCount
FROM tableName
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now