SELECT IF

SELECT IF permanently selects cases for analysis based on logical conditions that are found in the data. Unselected case are deleted from the active dataset.

SELECT IF [(]logical expression[)]

The following relational operators can be used in logical expressions:

Table 1. Relational operators
Symbol Definition
EQ or = Equal to
NE or ~= or ¬ = or <> Not equal to
LT or < Less than
LE or <= Less than or equal to
GT or > Greater than
GE or >= Greater than or equal to

The following logical operators can be used in logical expressions:

Table 2. Logical operators
Symbol Definition
AND or & Both relations must be true
OR or | Either relation can be true
NOT Reverses the outcome of an expression

This command does not read the active dataset. It is stored, pending execution with the next command that reads the dataset. See the topic Command Order for more information.

Syntax for the SELECT IF command can be generated from the Select cases dialog by selecting If condition is satisfied and selecting Deleted for unselected cases.

Example

SELECT IF (SEX EQ 'MALE').