Jump 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.

Featured Replies

I have a field sales tax. I need a good calculation for this field. The calculation has to say:

If the description field is occupied and the dealer license field is occupied then don't charge sales tax, or if the misc description field is occupied and the tax exempt field is occupied then don't charge sales tax or if the field "sales tax" which is a value list with yes/no and the answer is "No" then done't charge sales tax other wise add the price plus buyers fee together then times by .066.

case(

not isempty(t_desc) and not isempty(t_dealerlic), 0,

(not isempty(t_miscdesc)and not isempty (t_taxexempt), 0,

t_salestax = "No", 0, (n_price + n_buyerfee) * .066 )

What I'm trying to say is

if t_desc is not empty and t_dealerlic is not empty then charge "0", or if t_miscdesc is not empty and t_taxexempt is not empty then charge "0", or if t_salestax = "No" then charge "0", otherwise charge the (n_price to n_buyerfee) * .066.

Could I get some help on this calculation?

Perhaps you want this:

case(

(not isempty(t_desc) and not isempty(t_dealerlic) or

(not isempty(t_miscdesc) and not isempty (t_taxexempt)) or

t_salestax = "No", 0,

(n_price + n_buyerfee) * .066 )

The way you wrote it, if the first condition evaluated to "true" you'd get 0, even if t_salestax was set to "Yes." This way you get 0 if any one of those 3 things is true.

  • Author

thanks Fitch that's what I needed.

Hi Tom,

I getting too many separators at the "No" spot?

Lee

That's fine,

just add " ) " to < not isempty(t_dealerlic) >

...not isempty(t_dealerlic) )

Tom is not that lazy guy with Copy/Paste from the computer grin.gif

Thanks Ugo,

blush.gif

Good catch, Ugo. (You don't expect me to actually TEST these things, do you?)

(this and that) or (this and that) or

this and (that or this) and that

Now, assuming we've got the parentheses where they belong -- I'm not even certain that they are strictly necessary. But when in doubt, why not err on the side of safety? IMO it also makes the logic easier to read when you look at it later.

Create an account or sign in to comment

Important Information

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

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.