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 allocation

Status
Not open for further replies.

kathymo

Programmer
May 23, 2000
2
US
I am working on a cost report in Crystal Reports ver. 10 and I am trying to display cost distributed over a chargeback percentage. Below is an example of how the report should look. For this example Job #1 has a total cost of $200.00
Job Chargeback Code %Distribution Chargeback Cost
1 100 20 40.00
1 150 5 10.00
1 200 75 150.00

Below is the formula used to calculate the Chargeback Cost:
{@OQ_Price} * ({ChargeBackDistrib.DistPercent}/100)

The issue is that the individual chargeback costs do not always add up to the total cost that was allocated. There is sometimes a cent or two difference. I have tried rounding and truncating functions within the formula, but have not found a fix for this.

Is there any way to ensure that the indvidual allocations add up to the original total amount?

Thanks.
 
Please show the content of {@OQ_Price} and of any nested formulas. It would help if you showed a sample that illustrates the problem--where the elements don't total.

-LB
 
Can you show us an actual example of a distribution that is off by a penny? I mean one that is exactly as it appears on a real report? Prorating like this can easily generate rounding errors, even when it works correctly, especially if the percentages can be other than integers

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top