[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 750
  • Last Modified:

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?
0
jnikodym
Asked:
jnikodym
1 Solution
 
dougvargaCommented:
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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now