Skip to main content

Set modifiers with set operators

ON THIS PAGE

Set modifiers with set operators

Set operators are used to include, exclude, or intersect different element sets. They combine the different methods to define element sets.

The operators are the same as those used for set identifiers.

Operators
Operator Description
+ 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 (XOR). This binary operation returns a set consisting of the records that belong to either, but not both of the two set operands.

For example, the following two modifiers define the same set of field values:

  • <Year = {1997, "20*"}>

  • <Year = {1997} + {"20*"}>

Both expressions select 1997 and the years that begin with 20. In other words, this is the union of the two conditions.

Set operators also allow for more complex definitions. For example:

<Year = {1997, "20*"} - {2000}>

This expression will select the same years as those above, but in addition exclude year 2000.

For more information, see Set operators.

Examples: Chart expressions for set modifiers with set operators