Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How calculate based on a selected value

Featured Replies

I am developing a database for a customer. He wanted me to be able to calculate tax based on a price put in a field. That was not a problem. The problem now is he only wants the tax amount to show if it is resale, but not if it is wholesale. So I was thinking, that I could put a resale button and a wholesale button. If it is resale he just clicks yes in the field and the tax amount will be figured out.

Not sure how to do this. How can I trigger that button when he clicks yes to take the Price and put the tax amount in the "Tax amount field"? Hope this makes sense.

Here is what I used when I figured his tax. When a price is put in the Sale field it calculates and puts the tax in the Tax field.

Inventory = Sale * .0825

May be this calculation solves your problem without any scrtipt or button:

Inventory=

If(SaleTypeField = "Resale";Sale*0.0825;Sale)

Adam Djuby

A case statement would work here.

Case (WholeSale = "Yes"; Sale Amount; Sale Amount * Sales Tax + Sale Amount)

WholeSale = text and I attach a choice of Yes or No

Sales Tax = is a field that you can put your tax rate

HTH

Lee

  • Author

Excellent. I have been working with this. Where do I put the case statement? Do I attach it to a field or do I do it in scriptwriter? Thank you.

  • Author

Fantastic. That worked great. Just two small problems though. If it is wholesale then there is not any tax being added. That part works. But want happens is the Sale Price amount shows also in the Total field.

I have to have that null if it is not resale. How do I correct that.

Also it is giving me the total sale; price plus tax amount. I just need the actual tax amount showing, i.e. $850.00 at 0.0825 is $70.125 tax. I need the $70.125 tax to show, not $920.125.

Also your example was excellent. Thank you for the great help and such quick response. I am new at this but really enjoying it.

The best forum I have ever been on.

Edited by Guest

  • Author

Excellent. I figured it out myself. I just took the plus Sale amount out. It worked great. Hey I am acutally learning something with all the help in this forum.

I still have the problem of the Sale Amount showing up in the Total Tax if it is Wholesale. This field needs to be empty of it is Wholesale. What do I need to do? Thank you.

Thank you again.

Edited by Guest

You should separate TAX from The Total - i.e.:

you should have a Subtotal (which is either a number or some calculated value--- then you should have several other fields:

WholeSale (Yes or No) as described in Lee's example -

Tax Rate - default to .0825 if you wish - but I would NEVER make it a calculation - rates change and you want to keep older invoices with older rates.

Tax Amount - Case(Wholesale="No", 0 , Tax Rate * Subtotal)

then - Grand total (or whatever) = Subtotal + Tax

  • Author

Thank you. I took what you had and changed it a little and it worked just they way I needed it to. Thank you again.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.