5 pts.
 Lotus Formula @if
Have a subform that I am trying to set the value of Tax based on a plant field and useage. If the Plant is 3 then tax is 5% for everthing. If Plant is 1 or 2 then tax is 7% on non production and 0% on production.

Here is the code for the Tax field.

@If(Type3 != "Plant#3") & @If(Prod != "Production");@Sum(SubTotal * 0.07);@If(Type3 = "Plant#3");@Sum(SubTotal * 0.05);0



Software/Hardware used:
lotus notes 6.5.4
ASKED: October 6, 2009  2:17 PM
UPDATED: October 9, 2009  1:50 PM

Answer Wiki:
Try this: @If(Type3 != "Plant#3"; SubTotal * 0.05; @If(Prod != "Production"; SubTotal * 0.07; 0))
Last Wiki Answer Submitted:  October 7, 2009  3:04 pm  by  Ledlincoln   1,620 pts.
All Answer Wiki Contributors:  Ledlincoln   1,620 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Actually, I don’t think you need to specify the second @If (and I don’t think the code above calcs the tax correctly); this should work:

@If(Type3 = “Plant#3″; SubTotal * 0.05; Prod = “Production”; 0; SubTotal * 0.07 )

 2,700 pts.

 

Stiletto is right; I had a logic error (the first !=). This, or Stiletto’s version would be correct.

@If(Type3 = “Plant#3″; SubTotal * 0.05; @If(Prod != “Production”; SubTotal * 0.07; 0))

 1,620 pts.