# SHIFT VALUES

This command is available as of version 17.0. It deals with problems that were formerly were tackled using `COMPUTE`

together with the `LAG`

operator.

**Note:** I have tried it, and it works; but I did not yet find the find the time to explain it all. Those who have an idea what "lags" and "leads" are will understand easily what it's all about.

*Four simple examples*:

SHIFT VALUES VARIABLE = var1 RESULT = var2 LAG = 1. SHIFT VALUES VARIABLE = var1 RESULT = var2 SHIFT = -1. SHIFT VALUES VARIABLE = var1 RESULT = var2 LEAD = 1. SHIFT VALUES VARIABLE = var1 RESULT = var2 SHIFT = 1.

The first and the second example are equivalent, just as are the third and the fourth.

The number 1 or -1 may be replaced by other integer numbers, including 0 (zero). I don't know whether there is a limit.

© W. Ludwig-Mayerhofer, IGSW | Last update: 07 Feb 2010