Crystal Reports If Then

I am trying to figure out a formual in Crystal reports that will do the following.  I have a commission report set up for salespeople.  I have the report grouped by salesperson.  The report basically shows the salesperson, what sales are eligble for commission, the sale amount and the commission pay amount.  I want to add a bonus to the commission pay if the salesperson sales exceed a specific number.  The issue is i want that sales amount and bonus amount to be diffrent for each salesperson.  The below works but i need to be able to add other if then statements to the formual to account for diffrent sales and bounus numbers.

if (salesperson)='johndoe' and (salesamount)>100000 then (compay)+500 else compay

How would i fix this to add 'janedoe' when her sales go over 150000 she gets a 1000 bonus?
jnikodymAsked:
Who is Participating?
 
dougvargaConnect With a Mentor Commented:
if (salesperson)='johndoe' and (salesamount)>100000 then (compay)+500 else
if (salesperson)='janedoe' and (salesamount)>150000 then (compay)+1000 else
if (salesperson)='billybob' and (salesamount)>200000 then (compay)+2000 else
 etc.etc.etc (for each salesperson)
else compay
0
 
jnikodymAuthor Commented:
thank you dougvarga
0
 
mlmccCommented:
That solution doesn't work as you desire it.  If Jane makes over 100000 the bonus is 500
You need to test in the other order.  Highest amount first

If if (salesperson)='johndoe' then
(
   if (salesamount)>150000 then
       (compay)+1000
   else if (salesamount)>100000 then
       (compay)+500
   else
       compay
)
else if (salesperson)='billybob' then
(
   if (salesamount)>170000 then
       (compay)+1000
   else if (salesamount)>120000 then
       (compay)+500
   else
       compay
)
etc.etc.etc (for each salesperson)
else
    compay

mlmcc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.