2 Replies Latest reply on May 15, 2012 8:42 AM by philmodjunk

    help with calulation



      help with calulation


      Hello. I am trying to set up a payroll calulation field and i need help.  Basically what i want is a field that will return the payout of a rep based on if their base pay is greater than their commission it will return what their base pay is, but if their commison is greater than their base pay it will return their commssion.

      ok, first i have 50 fields called DBA 01 - 50. Each DBA field = $14 depending on how many company names i put it. EX:  1 DBA = $14 while 7 DBA = $98 (14*7)

      second, i have a field called Commission that mulitpies each DBA field by $14 giving me an estiment on payroll.

      lastly, i have a field called Base Pay that mulipies whatever hours i put in by 7.25

      Now i have a field called Pay out and ive tried this: If ( Base Pay > Commission; Base Pay  or If (Commsion > Base Pay; Commsion) ) but it doesnt return what i want. I hve also tried this 3 different way but still nothing works...

      what am i missing?

        • 1. Re: help with calulation

          if("statement";[result 1];[result 2]), what you seem to be trying is an if statement in an if statement, which is a legitimate thing to do, you just have to set it up a bit differently: If(Base Pay> Commission; Base Pay;(if(commission>Base Pay;Commissiion))) hope that helps.  It's basically saying "if this first statement is true, report base pay.  If the first statement is false, go to result two (which is an if statement so it checks the opposite, and will report that value)"

          • 2. Re: help with calulation

            ok, first i have 50 fields called DBA 01 - 50.

            Not the best database design. Consider a related table of records instead where one record represents DBA 01, a second record is used for DBA 02, etc. This gives you a much more flexible design for your database.

            With regards to your If calculation, Chad Mangum is on the right track but we can simplify it to:

            If(Base Pay> Commission; Base Pay ; Commission )

            You can also use the Max function: Max ( Base Pay ; Commission )