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

Percentage of Total After calculating Total

Status
Not open for further replies.

klameer

Technical User
Jun 21, 2002
26
LK
Hi,
I need to calculate the percentage of a total for each member of a group. The thing is the percentage should be calculated AFTER the total figure is arrived at.
I can do it with a sub report where the total figure is calculated and passed through a shared variable but I'm sure there must be an easier way.

Thanks in advance,

Karim
 
In Crystal 8.5, you can right-click, chose [Insert] and get a summary field or a running total. Summary fields are less subtle, but the value is taken from the data and therefore exists before the group is printed. So you should be able to calculate a percentage from it for individual items.

Does this help?

Madawc Williams
East Anglia, Great Britain
 
Here's an example:

A report has a group by Member, and there is a value called sales.

Palce the Sales in the details and right click it and select insert->Summary->Sum and request that it create a summary for the Member group, and also check the Incude grand totals box if CR 8.5 (consider posting technical information when requesting it).

Now you can create a formula to use these 2 values, even at the Member Group Header or Footer:

Insert->Field Object->right click formulas and select New->Name it

Do the math using these newly created summary fields:

(Group #1 Member: sum of field/Report area sum of field) *100

You can then format it to include a percentage sign by right clicking the formula and selecting format field->Number->Customize->Currency Symbol->Enable Currency Symbol->Change position to (123)$ and the currency symbol to %

-k
 
Guys,
I think you may have misunderstood me.
Both of these will calculate a summary but it will running total fields. If you place the formula at the group footer or report footer levels they will have the required result but only after the details fields have been filled.
I want to fill the details fields with a formula that deals with the TOTAL of the details fields WHILE the details fields are being printed.

Help!

Karim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top