Select cases: Functions for expression

The Functions for expression dialog allows you to select subsets of cases using conditional expressions. A conditional expression returns a value of true, false, or missing for each case.

  • If the result of a conditional expression is true, the case is included in the selected subset.
  • If the result of a conditional expression is false or missing, the case is not included in the selected subset.
  • Most conditional expressions use one or more of the six relational operators (<, >, <=, >=, =, and ~=) on the calculator pad.
  • Conditional expressions can include variable names, constants, arithmetic operators, numeric (and other) functions, logical variables, and relational operators.

Selecting cases based on conditional expressions

  1. From the menus choose:

    Data > Select cases...

  2. Click the advanced condition editor control.
    Advanced condition editor control
  3. Click Condition editor and then click Insert function to display the Functions for expression dialog.
  4. Select an appropriate function and then click OK.
  5. To build an expression, either paste components into the provided field or type directly in the field.
  6. Click Apply.
  • You can paste functions or commonly used system variables by selecting a group from the Functions for expression dialog list. Fill in any parameters indicated by question marks (only applies to functions). The function group labeled All provides a listing of all available functions and system variables. A brief description of the currently selected function or variable is displayed in Functions information area in the dialog.
  • String constants must be enclosed in quotation marks or apostrophes.
  • If values contain decimals, a period (.) must be used as the decimal indicator.