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

How to get record count of a group

Status
Not open for further replies.

williey

Technical User
Jan 21, 2004
242
The subject says it all. I like to find out how many record are there in the detail section by group level. Next is the get the average value by summing up all values by group and dividing by the no of records..

eg. 20 records in detail section of 1 group. But the sum of the values of 20 items is 200. Avg is 200/20 = 10.

How can one program this in CR?
 
This is Crystal version specific, sharing basic information like that will net specific answers as there is an average function in some versions.

Right click a field and select Insert->Summary->Count and request it at the Group level.

Do the same and request it as a grand total.

Now create a formula and select the count summaries just created to make a formula.

Not sure what you mean by your average formula, it makes no sense, to express this as a percentage it would be:

(count(group)/Count(grand total))*100

Your example says divide 200/20, which mathematically works in your example, but it has nothing to do with an average, and is wrong (try placing 40 in there, the bigger the number the smaller the average???).

Anyway, you get the idea.

-k
 
Thanks for the quick response! I'm using CR v8.0. What I am trying to do is to total up the values in "col 1" and get the average of "col 1" by group level.
Display the average as subtotal and finally as a grand total.
I did see the "Average [fld]" function. But I'm not if it will perform what I was trying to achieve. Thanks!

 
Total up doesn't clarify...

Summing would clarify if that's what you mean by a total, your original post said Counting ("how many record are there").

The same logic applies, use the insert->Summary->Sum, it's all built into Crystal.

-k
 
Thanks! I got it.. I miss seeing the "average" in the drop-down box.
 
hello, how can i count records that meets only the conditon in crystal reports, for example if counting only prices that is > $200. can anyone help me?

thank u.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top