5 Replies Latest reply: Oct 23, 2017 8:19 PM by Sunny Talwar RSS

    Calculate salesbonus based on max bonus value

    Birkir Bjornsson

      Hi,

      I am trying to create an app that calculates salesbonus for our Salespersons. It works in steps so items between 1-10 give 100, between 10-20 200 and so on until 500 is reached. But the problem is that it works backwards, so if you have reached 20 the amount is 200 for every item sold, also items between 1-10 etc. So I need to find a way that finds the max value of bonus amount and applies to all former items sold.

         

      SalesStaffSalesDateMax(QtySumInsurance)Max(BonusAmt)
      BBK10/2/2017 0:006100
      BBK10/3/2017 0:0011150
      BBK10/4/2017 0:0016150
      BBK10/5/2017 0:0022200
      BBK10/6/2017 0:0030200
      BBK10/9/2017 0:0036250
      BBK10/10/2017 0:0038250
      BBK10/11/2017 0:0042300
      BBK10/12/2017 0:0047300
      BBK10/13/2017 0:0056350
      BBK10/14/2017 0:0055350
      BBK10/16/2017 0:0059350
      BBK10/17/2017 0:0061400
      BBK10/18/2017 0:0065400
      BBK10/19/2017 0:0069400

      So in this example 400 is the maximum and I would like to be able to use that as a multiplier for items back in time or for example for 10/2/2017 I would calculate 6*400 = 2400.

       

      Any ideas on how to solve this?

       

      Regards

      Birkir