# RELATIVE

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&#x26;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&#x26;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&#x26;token=28853fe8-8704-4e68-a042-e2f66bb9dfd2" alt=""><figcaption><p>Using calculated column in downstream calculations</p></figcaption></figure>


---

# 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.inforiver.com/formula-syntax/identifiers/relative.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.
