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!

Percent of Total Help Needed

Status
Not open for further replies.

Bennie47250

Programmer
Nov 8, 2001
515
US
Using Crystal version 7.0

Report has the detail section suppressed.

In the Group footer (group by account number) there is a running total that counts the number of product shipped (by each account number; resets on change of account number)

In the Report Footer there is another running total that counts the total number of product shipped.

In the Group footer, I would like to show the percent this product is of the total however the formula I’m using is not returning correct values. I think it has to do with when the % calculation is being performed the Total is unknown but I don’t know how to workaround this.

Example
Shipped %
Coke 10 29%
Dr Pepper 20 57%
Pepsi 5 14%
Total 35

Thanks
Bennie
 
Lets start with you posting the formula you have now, and what results you are getting instead of 100% Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
The formula is:
{#2000 Product Mix}/{#2000 Prod Mix Total}

The results are:
sold %
Coke : 1 1
Pepsi : 1 1
Dr Pepper: 33 1
Sprite : 15 0
Peach : 1 0
Grape : 1 0
Total : 52
 
the problem is that you are dividing a running total record by another, and the denominator of this division, {#2000 Prod Mix Total} has not even been evaluated yet.

Is there a reason why you are using running totals instead of summaries?

Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
I'm using running totals because the database has three years worth of data in it and the product mix is shown for each year. By having a formula in the running total that evaluates the year, I’m able to do this. I don’t think I can do this any other way.
 
Write a record selection formula to only return the data for the year you want to see.

Then get rid of your running totals and just ad normal sub and grand totals. Then do your division of the subtotal object by the grand total object.

Let me know if you have any questions. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Thanks that did it. Fortunately this report lends itself to doing it this way. There’s got to be a way to perform these types of calculations using running totals thought well at least I would think so.

Thanks for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top