We help IT Professionals succeed at work.

Crystal Reports If Then

Medium Priority
Last Modified: 2013-12-11
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?
Watch Question

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.

Ask the Experts


thank you dougvarga
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

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
   else if (salesamount)>100000 then
else if (salesperson)='billybob' then
   if (salesamount)>170000 then
   else if (salesamount)>120000 then
etc.etc.etc (for each salesperson)

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

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

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.