> For the complete documentation index, see [llms.txt](https://docs.inforiver.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inforiver.com/formula-syntax/identifiers/relative.md).

# RELATIVE

Converts an absolute cell or column reference into a relative reference for dynamic calculations.

The **RELATIVE** identifier changes the absolute cell/column reference to a relative reference.

### Syntax

Cell reference

```javascript
Relative(CELL_REF)
```

Column reference

```
[Column1].Relative(-1)
```

### Arguments

* CELL\_REF - Reference to a cell.
* \[Column1] - Reference to a column.

The argument in case of column reference should be a negative number.

### Examples

{% hint style="warning" %}
Relative reference will not work correctly if columns are reordered. Column references from the original layout will be used. Also, it is applicable only when inserting visual measures and not columns.
{% endhint %}

#### **1. Cell reference**

Consider ship mode cost for each month. To increase the cost of ship mode by the month's total, you can use the 'Relative' function and select the cell as shown in the below image.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2Fj9M2GKSlVxRECQI1QqfJ%2FFormula%20relative%20cell.png?alt=media&amp;token=64048cd0-5257-48cb-986d-c6cef381c02f" alt=""><figcaption><p>Relative cell reference</p></figcaption></figure>

Total cost in April = 126.46k

Increased cost for Bookcases -> First Class = 1.06k +126.46k =127.53k

Note that even though we have used the reference to April's total in the formula, it applies the corresponding month's total for the calculation. That is, for Bookcases -> First Class -> January, the updated cost is 0.72k +97.67k, 97.67k being January's total.&#x20;

#### 2. Column reference

Consider an example where you want to calculate the variance between the current month's sales and the prior month's sales. The prior month's sales can be calculated using 'Relative' as shown below.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FhE1P4U2jLVJ2iz7UUbf8%2FFormula%20relative%20column.png?alt=media&amp;token=5a45fd73-3142-4ba1-9574-01408422ea59" alt=""><figcaption><p>Relative column reference</p></figcaption></figure>

This column can be used to calculate variance using the formula shown in the image. Note that IFNA has been used to assign 0 in case of calculation errors.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FIZYXtqDCfHlCqXmxbEov%2FFormula%20relative%20column%202.png?alt=media&amp;token=28853fe8-8704-4e68-a042-e2f66bb9dfd2" alt=""><figcaption><p>Using calculated column in downstream calculations</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.inforiver.com/formula-syntax/identifiers/relative.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
