Combining Formulas

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • Answered
Hello,

I posted a question and got this answer:

([Payment Amount]-[Client Fee Due]-Nz([Override Due]))/2

This was VERY helpful; however, I would like to also do an override on certain sales groups.  Here is what I suggest but there is an error.

If([Marketing Rep],= "SALES REP A", [Payment Amount]*.07)

or

([Payment Amount]-[Client Fee Due]-Nz([Override Due]))/2

Thanks for your help!
Photo of Jake

Jake

  • 130 Points 100 badge 2x thumb

Posted 7 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,296 Points 50k badge 2x thumb
Try this



If([Marketing Rep],= "SALES REP A", [Payment Amount]*.07),


([Payment Amount]-[Client Fee Due]-Nz([Override Due]))/2)
Photo of Jake

Jake

  • 130 Points 100 badge 2x thumb
I am getting a syntax error.  I'm not able to find the problem.  Any help would be appreciated, thanks.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,296 Points 50k badge 2x thumb
Sorry
There was an extra comma

If([Marketing Rep]= "SALES REP A", [Payment Amount]*.07),

([Payment Amount]-[Client Fee Due]-Nz([Override Due]))/2)
Photo of Jake

Jake

  • 130 Points 100 badge 2x thumb
Now it is saying there are extra characters beyond the end of the formula.
Photo of Jake

Jake

  • 130 Points 100 badge 2x thumb
Any additional help would be appreciated.  Thanks,
Photo of Evan Martinez

Evan Martinez, Community Manager

  • 8,774 Points 5k badge 2x thumb
Hi Jake,

Do you still get this error message if you try this version:

If([Marketing Rep]= "SALES REP A", [Payment Amount]*.07, 
([Payment Amount]-[Client Fee Due]-Nz([Override Due]))/2)
Photo of Jake

Jake

  • 130 Points 100 badge 2x thumb
Hello Evan,

Yes I still get an error message for a formula syntax error.  (there are extra characters beyond the end of the formula)

Photo of Evan Martinez

Evan Martinez, Community Manager

  • 8,774 Points 5k badge 2x thumb
Unfortunately it does not look like that screenshot came through. When that error message pops up does it give you an indication where the extra character is? It often underlines or highlights the character that is beyond the end of the formula in the pop up message. Is that the full formula or does it connect to anything else or have any other characters in there? The version I posted back took out one of the parenthesis so ideally that should have resolved any extra characters. 
(Edited)
Photo of Jake

Jake

  • 130 Points 100 badge 2x thumb
Understood.  It highlights the whole formula after the comma in the first formula (at the end of the formula).  Sorry the screenshot didn't work
(Edited)
Photo of Evan Martinez

Evan Martinez, Community Manager

  • 8,774 Points 5k badge 2x thumb
Hi Jake,

That is unusual, so in this line shown [Payment Amount]*.07, it specifically breaks on the , or just after it? Previously there was another ) there that would have broken the formula. If you are still getting an error you might want to put in a support case so that a Rep can visit your app and take a look at that formula to see what else might be going on. 
Photo of Jake

Jake

  • 130 Points 100 badge 2x thumb
It breaks on the comma.  I can put in a support case if you want me too.
Photo of Evan Martinez

Evan Martinez, Community Manager

  • 8,774 Points 5k badge 2x thumb
Hi Jake,

At this point I would suggest a Support Case just to be sure. A Care Team member can take a look at it with an invite to the app and see what is going on since the screenshot didn't seem to work. Then they can help you troubleshoot the formula. Sometimes seeing it in the app environment helps to put the error into context since the suggested changes didn't stop the error.