SHIFT VALUES

The SHIFT VALUES command creates new variables that contain the values of existing variables from preceding or subsequent cases.


SHIFT VALUES VARIABLE=varname RESULT=varname {LEAD=non-negative integer}
                                             {LAG=non-negative integer }
                                             {SHIFT=integer            }
  [/VARIABLE=varname...]

This command reads the active dataset and causes execution of any pending commands. See the topic Command Order for more information.

Syntax for the SHIFT VALUES command can be generated from the Shift Values dialog.

Release History

Release 17.0

  • Command introduced.

Example

SHIFT VALUES VARIABLE=OldVar RESULT=NewVar LEAD=1.