# otp.Column.tick_shift

#### Column.tick_shift(offset, , , group_by=None)

Returns the value of this column from a tick preceding the current one by `offset`.

Boundary values will be set to the default value by type: 0 for integers, empty string for strings, etc.

* **Parameters:**
  * **offset** ([*int*](https://docs.pip.distribution.sol.onetick.com/api/types/int.html.md#onetick.py.int)) -- Non negative offset looking back from the current tick.
  * **group_by** ([*str*](https://docs.pip.distribution.sol.onetick.com/api/operation/str/root.html.md#onetick.py.Operation.str) *|* [*list*](https://docs.python.org/3/builtins/stdtypes.html#list) *[*[*str*](https://docs.pip.distribution.sol.onetick.com/api/operation/str/root.html.md#onetick.py.Operation.str) *]*) -- Specifies a field name or a list of field names,
    in which case `offset` is counted among the ticks with same values of the specified fields.
* **Return type:**
  [`Operation`](https://docs.pip.distribution.sol.onetick.com/api/operation/root.html.md#onetick.py.Operation)

### Examples

```pycon
>>> data = otp.Ticks(A=[1, 2, 3, 4, 5, 6, 7, 8, 9], B=[1, 1, 1, 2, 2, 3, 3, 2, 3])
>>> data['A1'] = data['A'].tick_shift(1)
>>> data['A1_GROUP_BY_B'] = data['A'].tick_shift(1, group_by='B')
>>> otp.run(data)
                     Time  A  B  A1  A1_GROUP_BY_B
0 2003-12-01 00:00:00.000  1  1   0              0
1 2003-12-01 00:00:00.001  2  1   1              1
2 2003-12-01 00:00:00.002  3  1   2              2
3 2003-12-01 00:00:00.003  4  2   3              0
4 2003-12-01 00:00:00.004  5  2   4              4
5 2003-12-01 00:00:00.005  6  3   5              0
6 2003-12-01 00:00:00.006  7  3   6              6
7 2003-12-01 00:00:00.007  8  2   7              5
8 2003-12-01 00:00:00.008  9  3   8              7
```

#### SEE ALSO
[`__getitem__()`](https://docs.pip.distribution.sol.onetick.com/api/operation/__getitem__.html.md#onetick.py.Column.__getitem__)
<br/>
**TICK_SHIFT** OneTick function
<br/>
