Problem : Crystal Report How to Sum a Distinct Count Field in the Report Footer

Problem : Crystal Report How to Sum a Distinct Count Field in the Report Footer

I have a basic report that is counting the number of people by department.  I need to sum the count field.  I currently have distinctcount on the last name which works for counting by department.  When totaling for the group and report, I can’t use distinct count because one person may work in multiple departments as a floater.  Is there a way to use Sum to total a distinctcount field?


Solution : Crystal Report How to Sum a Distinct Count Field in the Report Footer

You can’t use a summary on a summary field.

You can use formulas

In the report header add a formula
WhilePrintingRecords;
Global NumberVar TotalCount := 0;

In the group footer (or where you display the department count)
WhilePrintingRecords;
Global NumberVar TotalCount;
TotalCount := TotalCount + SELECT THE SUMMARY FROM THE FIELD LIST

In the report footer
WhilePrintingRecords;
Global NumberVar TotalCount;
TotalCount