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

Having difficulty summarizing age stats. 1

Status
Not open for further replies.

qu1ncy

Programmer
Jul 25, 2002
95
CA
Hi,
I'm having difficulty getting the structure of this type of report straight. I have a report with empid, name, age, gender and need to summarize the data as in the following example.

Age Count %
18-33 211 33.7
34-50 339 54.1
51-78 77 12.3
----- -----
627 100.0

Average Age
628 Employees : 38.41
471 Women : 38.44
156 Men : 38.31

I've created formulas using "Age In 18 To 33" etc... and am grouping on the age range formulas. However, this isn't working cleanly. Is there a better way?

Thanks,

Q
 
That is how I would approach it. What is it doing wrong? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Hi kenhamady,
Sorry to take so long to reply. My results look like this:

Age Count %

18 - 33 342 51.58
34 - 50 342 51.58
18 - 33 250 37.71
34 - 50 250 37.71
-----------------------
Emp count 663

I'm inserting a grandtotal(count)of the age field into each group's footer. I only have 2 groups this far. However, I'm seeing duplicates in the preview. I have the group's headers suppressed. What am I forgetting here?

Q
 
You mentioned age range formulas - there should be just one formula. Could you post the actual formula.

Also post the actual names of your group fields. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
I've got 3 'age range formulas' that look like this:
{VU_COMPLETE_AGE_LISTING_RPT.AGE} in 18.00 to 33.00,
{VU_COMPLETE_AGE_LISTING_RPT.AGE} in 34.00 to 50.00,
{VU_COMPLETE_AGE_LISTING_RPT.AGE} in 51.00 to 78.00. I'm grouping on each separately.
The formula names are @18-33, @34-50, and @51-78. However, the actual group names are @18-33-A, etc... I'm doing a count on the empid field in each of the group footers.
The Emp Count & Average age fields are in the report footer.
Thanks,
Q
 
Write one formula that is:

if {VU_COMPLETE_AGE_LISTING_RPT.AGE} in 18 to 33
then "18-33" else
if {VU_COMPLETE_AGE_LISTING_RPT.AGE} <= 50.00,
then &quot;34 to 50&quot; else
if {VU_COMPLETE_AGE_LISTING_RPT.AGE} <= 78.00
then then &quot;51-78&quot; else
&quot;Other&quot;

Group on this formula (one group level which creates 3 groups in the reprot) and then do one total for this group, which will appear 3 times, 4 if you have others.
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Thank you Ken.
Works like a charm. This solution will have a broad application in a number of reports I have in my 'to do' list. I certainly appreciate your help!

Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top