# PERIOD\_LOOKUP

A PERIOD\_LOOKUP function returns any periods values.

### Syntax

PERIOD\_LOOKUP(offset, initialValue) - > \[number]

### Arguments

<table><thead><tr><th width="154">Arguments</th><th width="167">Datatype</th><th>Description</th></tr></thead><tbody><tr><td>offset</td><td>Number</td><td>The number of periods it has to go back or front.</td></tr><tr><td>initial Value</td><td>Number</td><td>The value of first period.</td></tr></tbody></table>

### Remarks

* This function can only be used after referring a node for which this calculation needs to be done as shown below in the example.
* If we give negative number for the offset it will go back to the past periods and vice versa.
* Period lookup will only work if there is 1 series (Year). To use it for multiple series PRIOR\_SERIES\_PERIOD\_LOOKUP function should be used along with PERIOD\_LOOKUP.

### Example 1

Consider a scenario where you want to calculate the closing balance of Non-Current assets by including the monthly movements. Below is the information.

<table><thead><tr><th width="180"></th><th width="64"></th></tr></thead><tbody><tr><td>Non-Current Asset Balance</td><td>$30 million</td></tr><tr><td>Depreciation (Straight line)</td><td>12% pa</td></tr></tbody></table>

To achieve this, the following formula should be written in the \[Opening Balance] node:

<mark style="color:purple;">**`[Closing Balance]`**</mark>**`.`**<mark style="color:blue;">**`PERIOD_LOOKUP`**</mark>**`(-1,30000000)`**

Closing Balance node name is referred in the formula before using PERIOD\_LOOKUP so that the calculation is performed for this specific node values. Since we have mentioned the first period value as $30 million it will take this as January month value. After that it will take the Closing Balance node as the previous period value as we have mentioned -1.

### Result

<table><thead><tr><th width="180">Period</th><th width="64">Jan</th><th width="64">Feb</th><th width="64">Mar</th><th width="64">Apr</th><th width="75">May</th><th width="64">Jun</th><th width="64">Jul</th><th width="64">Aug</th><th width="64">Sept</th><th width="64">Oct</th><th width="64">Nov</th><th width="64">Dec</th></tr></thead><tbody><tr><td>Opening Balance</td><td>30000000</td><td>29700000</td><td>29400000</td><td>29100000</td><td>28800000</td><td>28500000</td><td>28200000</td><td>27900000</td><td>27600000</td><td>27300000</td><td>27000000</td><td>26700000</td></tr><tr><td>Monthly movements</td><td>300000</td><td>300000</td><td>300000</td><td>300000</td><td>300000</td><td>300000</td><td>300000</td><td>300000</td><td>300000</td><td>300000</td><td>300000</td><td>300000</td></tr><tr><td><mark style="color:purple;">Closing Balance</mark></td><td>29700000</td><td>29400000</td><td>29100000</td><td>28800000</td><td>28500000</td><td>28200000</td><td>27900000</td><td>27600000</td><td>27300000</td><td>27000000</td><td>26700000</td><td>26400000</td></tr></tbody></table>

### Example 2

Consider a scenario where you have Year 1's Unit price value and Growth rate of Unit price for Years 2 to 5. We need to calculate the current year's price by taking the previous year's price and multiplying it with the growth rate.

<table><thead><tr><th width="255.80327868852464">Year</th><th width="94" align="right">1</th></tr></thead><tbody><tr><td>Unit price</td><td align="right">400</td></tr><tr><td><mark style="color:orange;">Growth rate (Years 2-5)</mark></td><td align="right">5%</td></tr></tbody></table>

To achieve this, the following formula should be written in the \[Unit Price] node:

**`(`**<mark style="color:blue;">**`THIS`**</mark>**`.`**<mark style="color:blue;">**`PERIOD_LOOKUP`**</mark>**`(-1,400)*(1+`**<mark style="color:orange;">**`[Growth rate (Years 2-5)]`**</mark>**`)`**

### Result

| Year       |   1 |   2 |   3 |      4 |      5 |
| ---------- | --: | --: | --: | -----: | -----: |
| Unit price | 400 | 420 | 441 | 463.05 | 486.20 |


---

# 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.valq.com/model/formula-functions/range-functions/period_lookup.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.
