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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count of summary function

Status
Not open for further replies.

apdageek

MIS
Mar 12, 2003
11
US
I have a Crystal Reports 10 report where I calculate the mode (most common value) donation for a group. I need to calculate the number of contributors who gave the mode amount in the group. How do I calculate this since Crystal Reports doesn't let you do a count of a summary field?

Thanks!
 
Try something like the following in the group footer:

numbervar MyCount;
if sum({table.donation},{table.group}) = mode({table.donation},{table.group}) then
MyCount:=MyCount+1

If you have outer groupings, you'll need to reset it in those.

And you can use the Numbervar MyCount in those outer groupings or the report footer.

Since you didn't share much about your intent or the report I can't help more unless you post environment/layout information.

-k

 
The report uses an Oracle database.

It displays no details, only group 1 (what fund they donated to) footers with summaries and group 2 (what type of contributor they are) footers with summaries.

I need to calculate how many contributors made the mode donation in group 1 and in group 2.

Hope this helps explain what I'm trying to accomplish.

Thanks!
 
Did you try the formula supplied?

It still doesn't describe where you want these totals, group header or group footer?

Are they to be reset?

Try the formula and then report back with what you need and where.

-k
 
I haven't been able to get the formula to work.

I need to have the formula in the group #1 and group #2 headers. It needs to be reset for each new group.
 
Try using a running total, using synapsevampire's formula to control counting.

Or you could clear the number variable for each group, something like
Code:
WhilePrintingRecords;
NumberVar MyCount :=0;
and place it in the group header.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top