Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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.

Posted

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

Posted

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.

Posted

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.

Posted

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!

This topic is 6899 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.