7 Replies Latest reply on Mar 3, 2015 8:51 AM by schamblee

# I can't figure out why this calculation is not working. I have never used the "not" and "and"...

### Post

I can't figure out why this calculation is not working. I have never used the "not" and "and" logical operators, so this is a first on both accounts in one simple if statement. I am trying to automatically populate a field based on if the "inv flag" filed is not empty and if the "dept.no" equals anything BUT "870130110". The formula below is not working.

If (
INV FLAG > "" and DEPT.NO. = not "870130110" ; "Inventoried Order" ; ""
)

• ###### 1. Re: I can't figure out why this calculation is not working. I have never used the "not" and "and"...

I think you want the operator "not" followed by the function "Isempty" for the INV FLAG,

and

the not equals operator (= with a line through it) for "Inventoried Order"

try just selecting these and not typing anything. Double click for the field selection.

• ###### 2. Re: I can't figure out why this calculation is not working. I have never used the "not" and "and"...

Your logic is not correct in your calculation.  How can INV FLAG ever be greater than nothing and there is not equal symbol ≠, so your calculation should be : If(not IsEmpty(INV FLAG) and DEPT.NO.  ≠ "870130110";"Inventoried Order";"")

• ###### 3. Re: I can't figure out why this calculation is not working. I have never used the "not" and "and"...

That worked perfectly! Thanks for the help. I have used:

> ""   in stead of:     not IsEmpty

in a couple of calculations. Is this bad practice?

• ###### 4. Re: I can't figure out why this calculation is not working. I have never used the "not" and "and"...

Well, I'm no expert, but as S Chamblee says, how can something be less, more, or = to "", which isn't zero - it's no value at all?

• ###### 5. Re: I can't figure out why this calculation is not working. I have never used the "not" and "and"...

The way I am using it, and it has been working for me, is that > "" is another way of saying not IsEmpty. I was just wondering what the difference is...if any. Like I said, it is working for me I just wanted to see if I should be going back on those old calculations and changing them all to say "not IsEmpty".

• ###### 6. Re: I can't figure out why this calculation is not working. I have never used the "not" and "and"...

You've proven that your previous approach works sometimes, but not all the time (the reason for your post). There is probably a clue here about why it performs inconsistently, maybe to do with the data differences (numbers, text, dates, etc), or some other difference in the context of the calculation, or conditions during execution.

The expression "notIsEmpty" (field) is not about relative size or amount (> or <) but is about lack of data - would be my guess as to why it is recommended for consistency.

• ###### 7. Re: I can't figure out why this calculation is not working. I have never used the "not" and "and"...

I wouldn't use that method, In my basic testing it seemed to work.  I don't think it is sound logic to use.  I know some other old programing languages such as gwBasic used <> to mean "not equal", because there is not "not equal" sign on the keyboard. From the old DOS days when you couldn't copy and paste.  I haven't used Filemaker that many years but I'm sure it is a carry over from long ago.  I think it is more reliable and easier to read by using IsEmpty.