I have a Saved Transaction Search set up to calcul...
# general
c
I have a Saved Transaction Search set up to calculate the Commission for our sales team. As you can see from the screenshot, we're using a 4% commission rate (and some other variables) to calculate the commission due to each sales team member. Here is what I need help with: each sales person now has 1) a different % base commission rate and 2) a different commission % rate for certain of the accounts they manage (usually a lower commission % for corporate accounts that they didn't open). Can anyone help with what formula they'd use to give each rep a unique commission % and then override that commission with another rate when they sell to a particular account to calculate the commission due? Thank you in advance for any help/insight!
j
Chris, we use a similar search and a formula using a CASE WHEN statement to calculate a different % for specific accounts. The format is CASE WHEN {entity} = 'entity name' THEN ({grossamount}-NVL({shippingamount},0)) * .05 WHEN <repeat for next entity>. You can add an ELSE after all the account-specific calculations to apply the general commission rate and end with END. Note you can nest CASE WHEN's, so you can including conditions to set the general commission rate for each sales rep after the ELSE.
🙂 1
c
Thanks so much for the reply Jeff! I will look at this implementation tomorrow morning. Again, appreciated!
Any idea why the following would be throwing 'ERROR: Invalid Expression'?
Copy code
CASE WHEN {salesrep} = 'Christina' THEN '5%' ELSE '4%' END
I figured it out: switched Formula to Text and Summary Type to Group. Duh! Thanks again!
I am re-working this to pull the commission % from the Customer form where I created it as a Custom Field called "custentitycommrate". When I run the code, I am getting ERROR: Field Not Found, which I suppose is because I am not pointing to "custentitycommrate" correctly. Would you mind pointing me in the right direction? Here is the code: CASE WHEN NVL({custentitycommrate}, 0) != 0 THEN (NVL({amount}, 0) - NVL({shippingamount}, 0) - NVL({taxtotal}, 0)) * {custentitycommrate} END
k
it would probably be customer.custentitycommrate or something like that since it's a join.
👍 1
c
Thanks Kevin. I'll give that a shot.