# Set operators

Set operators are used to include, exclude, or intersect data sets. All operators use sets as operands and return a set as result.

You can use set operators in two different situations:

* To perform a set operation on set identifiers, representing sets of records in data.

* To perform a set operation on the element sets, on the field values, or inside a set modifier.

The following table shows the operators that can be used in set expressions.

Operators

| Operator | Description |
| --- | --- |
| `+` | Union. This binary operation returns a set consisting of the records or elements that belong to any of the two set operands. |
| `-` | Exclusion. This binary operation returns a set consisting of the records or elements 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 or elements that belong to both set operands. |
| `/` | Symmetric difference `(XOR)`. This binary operation returns a set consisting of the records or elements that belong to either, but not both set operands. |

The following table shows examples with operators.

Examples with operators

| Example | Result |
| --- | --- |
| `Sum ({1-$} Sales)` | Returns<br>sales for everything excluded by current selection. |
| `Sum ({$*BM01} Sales)` | Returns<br>sales for the intersection between the selection and bookmark #160;`BM01`. |
| `Sum ({-($+BM01)} Sales)` | Returns sales excluded by the<br>selection and bookmark `BM01`. |
| `Sum ({$<Year={2009}>+1<Country={'Sweden'}>} Sales)` | Returns<br>sales for the year 2009 associated with the current selections and add the<br>full set of data associated with the country `Sweden` across<br>all years. |
| `Sum ({$<Country={"S*"}+{"*land"}>} Sales)` | Returns<br>the sales for countries that begin with `S` or end with `land`. |

See also:

* [Set analysis](https://help.qlik.com/en-US/sense/May2026/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAnalysis/set-analysis-expressions.htm)

* [Set identifiers](https://help.qlik.com/en-US/sense/May2026/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAnalysis/set-identifiers.htm)

* [Set modifiers](https://help.qlik.com/en-US/sense/May2026/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAnalysis/set-modifiers.htm)