# OFFSET

OFFSET( `column`, `number of rows`)

Returns a reference to a row relative to the current row, determined by the input `number of rows`. If `number of rows` is 0, returns the current row.

### Arguments

| Argument         | Description                                                             |
| ---------------- | ----------------------------------------------------------------------- |
| `column`         | Column to return                                                        |
| `number of rows` | Number of rows to offset. `number of rows` can be positive or negative. |

### Output

Values in `column`, offset by the given `integer`

### Example

Let's say we want to calculate the daily percent change in the SPY Index price. We could utilize OFFSET() in such a case to give us the previous day's price, allowing for a manual calculation of the daily percent change to then take place.

{% embed url="<https://datawrapper.dwcdn.net/Q91Pf/1/>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cascade.io/cascade/functions-and-expressions/functions/table/offset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
