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.

Using "OR" operator in an IF function....not working

Featured Replies

I've had alot of trouble getting a compound IF function to work... in fact, I've never gotten one to work.

Here's my latest effort. Can't figure out what I'm doing wrong.

If(LocCurrentRez::Apartment ≠ "n/a" or LocCurrentRez::Apartment ≠ "";"Apt: "&LocCurrentRez::Apartment;" ")

This occurs in the middle of a long calculation that concatinates a bunch of stuff into a giant global text field.

Everything works, except the lines "OR" in them. These work in the case of whatever condition I put first, but not what I put second.

The example is supposed to put " " in the field whenever LocCurrentRez::Apartment contains either nothing or "n/a"

As it is, it will put " " in the field for "n/a" but not for "".

So I'm guessing that there is something wrong w/how I'm using "OR"

Can't seem to find enough examples of the proper use of "OR" in functions to get the syntax clear in my head.




If( isEmpty(LocCurrentRez::Apartment) or LocCurrentRez::Apartment = "n/a"; " "; LocCurrentRez::Apartment)





That should work, if it doesn't there could be a problem with your relationship.

I prefer the case statement, for me they are easier to read, write and explain.

Case(LocCurrentRez::Apartment = "n/a"; " "; IsEmpty(LocCurrentRez::Apartment ); " "; "Apt: "& LocCurrentRez::Apartment)

Lee

The or in your quote always evaluates to true (the first statement is true unless LocCurrentRes::Apartment = n/a and then the second statenent is true since n/a is not empty).

The problem is in the use of not equal. In order to achieve your aim using "not equal" you must replace the or by and. Alternatively replace the not equal by equal and invert the order of the last two items of the If.

  • Author

Well, I'm still having a hard time getting my mind wrapped around it, but I do see that I have overlapping conditions... "anything but n/a" and "anything but empty"

Somehow it feels like these conditions should work sort of cumulatively with "or" but I guess not.

Anyway, it looks like I've got a couple of good alternatives here. THanks.

  • Author

Ah! I believe I get it.

If the value is "n/a" it is also not empty so it calculates to the true result.

Double negatives are just a bad idea for brains like mine!

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.