Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6878 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I would like to know how to write a script or calculation that will enter the tax amount depending on either of two radio buttons. i.e. I have two radio buttons - 'T0' and 'T1'. If T0 is selected then I want the tax amount to be 0, otherwise I want the result to be the net amount x 1.175.

Thanks for the help

Lyndon

Posted

I made the attach example up for someone else, but apparently not for the Forum, at least I couldn't find it. Anyway, it isn't exactly like you described, but should help you figure out what you want.

Lee

SalesRetail_Whole_Sale.fp7.zip

Posted

Answering the original question for future reference though, you could use either an if or a case statement to achieve what you want. Just pointing this out to you because these may in mamy cases be the basis for many of your calculations.

The format would be:

If(test , result if returns true, result if test returns false)

Case(

test, result if true,

test, result if true,

test, result if true,

more tests, more results if true,

default result if none return true

)

So in this case for example it would be If(taxfield = "T0" , 0 , netamount * 1.175 )

God comma's put me off...

~Genx

Posted

Tax rates change, so you shouldn't hard-code the rate into a calculation. It should be kept in a global field, or in a preferences/settings file, and looked up or auto-entered with the creation of a new record.

I would also calculate the TaxAmount separately - in case someone wants to figure how much tax they paid in total. The calc for this would be:

Round ( Amount * TaxRate * ApplyTax , 2 )

where ApplyTax is a Number field with either 0 (exempt) or 1 (taxed). The final sum to pay is Amount + TaxAmount.

Just to clarify, the TaxRate in this example would be 0.175, not 1.175.

Posted

I agree that hard coding is really not the way to go, however, I just gave Llyndonium what he/she asked for. You could simply enter the tax rate or use a VL and have one button with the simple calc comment has offered, or no button at all, and it solves the problem and gives a lot more flexibility.

This topic is 6878 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.