WHICH

WHICH(condition,...,condition)

conditionA conditional expression to evaluate.
Return:WHICH returns a single value.

The WHICH function evaluates which of the list of conditions returned true and returns its ordinal position in the list of conditions. Returns zero (0) if none return true. This is the opposite of the REJECTED function.

Example:

  Accept := WHICH(Person.per_first_name = 'Fred',
  Person.per_first_name = 'Sue');
  //Accept is 0 for everyone but those named Fred or Sue

See Also: REJECTED, MAP, CHOOSE, IF, CASE