I have a problem with an IF THEN ELSE function.
The function is the following:
measure= IF THEN ELSE (threshold1>=value1 :OR: threshold2>=value2 :OR: threshold3>=value3, 100, 0)
There is a problem with the logical operators. I want to express that, if one or more of the thresholds are reached or exceeded, measure turns 0. But it doesn't work.
Is it not possible to include :OR: in an IF THEN ELSE function? Probably I need to include :AND: somehow to state that the IF conditions can also happen in combination. :AND: or :NOT: are included in the Users Guide (as examples), so I expected :OR: to work as well...?
Danny
logical operators
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
The expression you have is valid and will return 100 if any one of the thresholds exceeds the value, otherwise it will return 0. Thus the way you have it all thresholds need to be exceeded to get 0. To get what you want you would use
IF THEN ELSE(value1 >= threshold1 :OR: value2 >= theshold2 :OR: value3 >= threshold3,0,100)
IF THEN ELSE(value1 >= threshold1 :OR: value2 >= theshold2 :OR: value3 >= threshold3,0,100)