Set Operators in Qlikview

Set Operators in Qlikview

There are several set operators that can be used in set expressions. All set operators use sets as operands and return a set as result.

+ (Union): This binary operation returns a set consisting of the records that belong to any of the two set operands.

– (Exclusion): This binary operation returns a set of the records that belong to the first but not the other of the two set operands. Also, when used as a unary operator, it returns the complement set.

* (Intersection): This binary operation returns a set consisting of the records that belong to both of the two set operands.

/ (Symmetric difference): This binary operation returns a set consisting of the records that belong to either, but not both of the two set operands.

The order of precedence is:

  • Unary minus (complement)
  • Intersection and Symmetric difference
  • Union and Exclusion

Within a group, the expression is evaluated from left to right. Alternative orders can be defined by standard brackets, which may be necessary because the set operators do not commute.

For example, A+(B-C) is different from (A+B)-C which in turn is different from (A-C)+B.