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

Countif Function

Status
Not open for further replies.

Ethelk2044

IS-IT--Management
Apr 6, 2004
8
US
I have a field in my report where I need to count the total for each employee as well as the grop they are in. For the example the field name is Service. Heather and Mark belongs to Telco department and Tom belongs to WAN Department. I need to count the number of times each employee's name appears in the department as well as give the total for the department. I know in Excel you would use the countif command. However, I do not know what to do in Crystal. I have listed an example below:

Service Group

Heather Telco
Mark Telco
Tom Wan
Tom Wan
Heather Telco
Mark Telco

Totals Group
Heather 2
Mark 2
Total 4 Telco

Tom 2
2 Wan
 
Try Running Totals. Right-click on a field and choose Insert to get a choice of Running Total, Summary and Grand Total.

Running totals allow you to do clever things with grouping and formulas. They also accumulate for each line, hence the name. The disadvantage is that they are working out at the same time as the Crystal report formats the line. You cannot test for their values until after the details have been printed. You can show them in the group footer but not the group header, where they will be zero if you are resetting them for each group.

Summary totals are cruder, but are based directly on the data. This means that they can be shown in the header. They can also be used to sort groups, or to suppress them. Suppress a group if it has less than three members, say.

Grand totals are much like summary totals, but for the whole report rather than groups. Note that summary totals include an option to have a grand total calculated on the same basis.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
If you insert a group on department and then another group on name, you can right click on the name field and insert a summary (count) at all group levels. You can then suppress the details section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top