Logical operators
The logical operators are And, Or, Xor, and Not. Use the And, Or, and Xor operators to combine expressions, and Not to negate expressions.
These operators always function as logical operators and not as
Bitwise operations.
And operator
Combine expressions with And if you want the combined expression to return True only when both of the expressions return True.
Syntax
<expression_1> And <expression_2>
Example
This expression selects female respondents who are currently in full-time education (that is, they answered Yes to the education question).
gender = {FEMALE} And education = {YES}
Or operator
Combine expressions with Or if you want the combined expression to return True when either or both of the subexpressions returns True.
Syntax
<expression_1> Or <expression_2>
Example
This expression selects all female respondents and all respondents (both male and female) who are currently in full-time education.
gender = {FEMALE} Or education = {YES}
Xor operator
Combine expressions with Xor when you want the combined expression to return True when one, but not both, of the subexpressions returns True.
Syntax
<expression_1> Xor <expression_2>
Example
This expression selects all female respondents who are not in full time education, and all male respondents who are in full-time education.
gender = {FEMALE} Xor education = {YES}
Not operator
Use Not to negate expressions.
Syntax
Not <expression_1>
Example
This expression selects male respondents and any other respondents who did not select the Female category; for example, because they refused to answer the question.
Not (gender = {FEMALE})
Parentheses are required around the expression because the
NOT operator has precedence over the comparison operators. For more information, see
Operator precedence.
See