2 Replies Latest reply on Feb 6, 2010 9:38 PM by beckett85_1

    Help Creating a "Case Function", I believe?



      Help Creating a "Case Function", I believe?


      Hey Gang,

      Trying to create more complex functions is over my head.  I *THINK* what I'm trying to do is create a "case" function, based on a series of tests.


      I'm building a database to host the Net P&L on an e-biz ... and the Net P&L is calculated different based on what marketplace an item sell in.


      Some marketplaces have the merchant fee built-in, but others where we use our own merchant processing have the fee as a separate transaction.  I'm trying to build a function that will calculate the "Merchant Fee" field, when there is one.


      Marketplace Field:


      Store3 *

      Store4 *

      *Store3 and Store4 have a merchant fee added to the transaction.


      How do I build the function so that I am saying:
      If the Marketplace Field is = Store3 or Store4, the merchant fee is the Gross * .029 + $.30, and if the Marketplace Field is Store1 or Store2, the merchant fee = $0


      In other words ... using 3 fields:
      Gross (total money on the order)
      Merchant Fee (calculation of 2.9% plus $.30, but ONLY if the Marketplace Field is one of the Stores that incur a merchant fee)


      I hope that makes sense.  If someone could help write out the formula below, I'd be very grateful!