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

Count number of specific Bool conditions in a group?

Status
Not open for further replies.
Aug 11, 2004
53
CA
I thought this was a simple problem, and CR10 would have a built in function for it, but I can't find it.

I simply want to count the total number of "Yes" values for a field in a group and put in in the group footer. Am I totally missing something, or should this not be a built in function?

Thanks in advance for your help.

Jason
 
Ttry a running total. Have it count for the group and use a formula to test for 'Yes'.

Right-click on a field and choose Insert to get a choice of Running Total, Summary and Grand Total. Or else use the Field Explorer, the icon that is a grid-like box.
It is also possible to get get totals using a Formula Field, which can contain a Variable or a Directly Calculated 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.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
If 'bool conditions' means boolians, then they will be true or false - try displaying one. You can also just refer to them by name, with not for false.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
You could create a formula{@Yes}:

if {table.field} = "Yes" then 1 else 0

Then right click on the formula and insert a sum (not count).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top