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!

Formula on Groups

Status
Not open for further replies.

JKW777

MIS
May 22, 2003
4
US
This seems easy but I'm stumped. I have a report with 2 groups based on accounts. I'm supressing detail lines and summarizing accounts at group 2. I'm trying to get a formula to calculate % as follows:

account amount % (of total amount)
GH1 REVENUE
GF2 12345 200 20
GF2 12356 300 30
GF2 12366 500 50
GF1 TOTAL 1000 100

My $$ totals work fine, but I can't seem to get the % to work. If I try to use the Sum of $$ as the denominator in my formula, it returns the grand total for Group 1 for the entire report. What confuses me is, why does Crystal list the summaries individually in the report expert if it doesn't distinguish between them in a formula?

I'm sure there is an easy solution. Any help would be appreciated.
 
Assuming that you're using a recent version of Crystal (supplying basic information is important), If you right click the amount column in the details and select insert summary-Sum, and base it on the GH1 grouping, then this sum will be available within a formula for computation with a GF 2 summary generated in a similar fashion. There are also Running Totals, which would not work.

You state that your totals work fine, but not how you built them, the latter is far more important.

Rather than pseudo examples and text descriptions, try posting technical information when requesting it:

Crystal version
Database/connectivity used
Example data
Expected output

Hope this resolves.

-k
 
The simplest approach would be to right click on {table.amount} in the detail section->insert summary->sum->use the dropdown to choose "The records will be sorted and grouped by: Group #2" and then check "Show as a percentage of: (use the dropdown) Group #1".

This will give you the same results as creating the following formula and placing it in the group#2 header or footer:

sum({table.amount},{table.group2field}) % sum({table.amount},{table.group1field})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top