We help IT Professionals succeed at work.

# Crystal Reports If Then

on
Medium Priority
759 Views
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?
Comment
Watch Question

## View Solution Only

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

Not the solution you were looking for? Getting a personalized solution is easy.

Commented:
thank you dougvarga
Senior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
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
##### Thanks for using Experts Exchange.

• View three pieces of content (articles, solutions, posts, and videos)
• Ask the experts questions (counted toward content limit)
• Customize your dashboard and profile