1. Home
  2. Restrict using Expression

Restrict using Expression

Select menu: Spread | Restrict/Filter | By Logical Expression

This dialog lets you restrict the rows in the spreadsheet used in an analysis, by the use of a general logical expression. The expression can be built as a conjunction of two Boolean expressions compounded with an OR or AND operator. The columns in the spreadsheet are displayed in a list and may be transferred to one of two sub-expressions.

  1. From the menu select Spread | Restrict/Filter | By Logical Expression.

Columns

The columns in the spreadsheet which can be used in the restriction expression. Clicking in an expression edit field then double clicking a column name will place this name in the expression at the current cursor position.

Expression

Two edit fields to build the restriction expression.

History button

The history button opens the Restriction History dialog which allows you to reuse a previous logical expression. The selected expression will be put into the Expression field that last had focus.

And/Or

The logical conjunction used to compound the two logical expressions.

Create expression

Open the Form Expression dialog to build the restriction expression.

Comparisons

Logical operators which can be used in the restriction expression. Clicking in an expression edit field then double clicking a comparison name will place the comparison at the current cursor position.

Restriction type

Units that meet the specified conditions can be either included or excluded from the restriction.

Existing restrictions

If this spreadsheet is currently restricted, this controls how the new restriction is added to the current restriction.

  • Combine – Combine the old restriction with the new one.
  • Replace – Replace the old restriction with the new one.

Action buttons

OK Restrict the spreadsheet as required, and close the dialog.
Cancel Close the dialog without making any further restrictions.
Apply Restrict the spreadsheet as required and leave the dialog open to apply further restrictions.
Remove All Remove any current restrictions on the spreadsheet.

Example

Expression 1: Year == 1997
And selected
Expression 2: Month .in. !(4,5,6)

This will select rows belonging to months 4,5,6 in 1997.

See also

Spreadsheet Restrict/Filter Menu for other methods of defining restrictions.
Restrict using Factor Levels
Restrict Units by Value
Save Restriction/Filter
Restrict/Filter Duplicate Rows
Restrict/Filter Random Rows
Spreadsheet Restrict/Filter Menu
Restriction History

The RESTRICT directive can be used to filter columns within the command language.

Updated on August 30, 2019

Was this article helpful?