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

Spliting Crystal Reports Formula Range

Status
Not open for further replies.

edison1135

Technical User
Mar 28, 2001
24
US
I’m using Crystal Reports 7 Access database to write a report against an Access database that will calculate earned sales commission. The bonus factor is determined by the instant total of an individual’s cumulative yearly sales. Since each marketing manager has different sales requirements and different assigned bonus factors, the formula is repeated a number of times for the different ranges and factors. I'm also using RunningTotals formulas extensively in this report. A sample of the formula, named BonusFactorAdjusted, I’m using to assign the bonus factor is listed below where @Evaluatesales is the cumulative sales total for Jones:

IF GroupName ({BID_SUBJ.MARKETING_MANAGER})= &quot;JONES&quot; and {@Evaluatesales} >= $1 and {@Evaluatesales} <= $4999 then 0.001
ELSE
IF GroupName ({BID_SUBJ.MARKETING_MANAGER})= &quot;JONES&quot; and {@Evaluatesales} >= $5000 and {@Evaluatesales} <= $9999 then 0.002

To determine the bonus earned for an individual sale, multiply the bonus factor from above by the dollar amount of the individual sale. As the cumulative sales amount crosses a dollar threshold, a different bonus factor will be used. The following formula is an example of determining the bonus

{@BonusFactorAdjusted}*{@Sales}


This approach is working except in the instances where a sale crosses the threshold from one bonus range to the next. As it works now, the entire amount for that sales is multiplied by the higher bonus factor.

What I would like to be able to do is split these amounts that cross a threshold so that both bonus factors could be applied to their respective dollar amounts. Here is an example of how it is working now using Jones' factors from above:

Sale cum total factor bonus

$3000 $3000 .001 $3 (3000 X .001)

$1000 $4000 .001 $1 (1000 X .001)

$2000 $6000 .002 $4 (2000 X .002)



Here is an example of how I would like to be able to split the amounts:

Sale cum total factor bonus

$3000 $3000 .001 3 (3000 X .001)

$1000 $4000 .001 1 (1000 X .001)

$2000 $6000 $ 999 @. 001 = $.999
$1001 @ .002 = $2.002


Thanks,

Edison1135
 
Do you mean something like this:

if Cuml <=4999
then sale *.01
else 4999 - (Cuml - Sale) * .001 +
Cuml - 4999 * .002 Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thanks Ken!! I just made a slight modification to your suggestion and it works fine for my situation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top