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

# CURRENT\_PERIOD\_INDEX

Current period index returns the value of the period that is selected.

### Example

Consider the scenario where you want to calculate the Balance due for a loan taken for $40000.

<table><thead><tr><th width="114">Periods</th><th width="64">Jan</th><th width="64">Feb</th><th width="64">Mar</th><th width="64">Apr</th><th width="64">May</th><th width="64">Jun</th><th width="64">Jul</th><th width="64">Aug</th><th width="64">Sep</th><th width="64">Oct</th><th width="64">Nov</th><th width="64">Dec</th></tr></thead><tbody><tr><td><mark style="color:purple;">Loan amount</mark></td><td>40000</td><td>35000</td><td>30000</td><td>25000</td><td>21000</td><td>17000</td><td>14000</td><td>11000</td><td>8000</td><td>5000</td><td>3000</td><td>1000</td></tr><tr><td><mark style="color:orange;">Amount paid</mark></td><td>5000</td><td>5000</td><td>5000</td><td>4000</td><td>4000</td><td>3000</td><td>3000</td><td>3000</td><td>3000</td><td>2000</td><td>2000</td><td>1000</td></tr></tbody></table>

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

<mark style="color:purple;">**`[Loan amount]`**</mark>**`-`**<mark style="color:orange;">**`[Amount paid]`**</mark>**`.`**<mark style="color:blue;">**`GET`**</mark>**`(`**<mark style="color:blue;">**`CURRENT_PERIOD_INDEX`**</mark>**`)`**

<table data-header-hidden><thead><tr><th width="158">Column1</th><th width="154">Column2</th><th width="148">Column3</th><th width="149">Column4</th><th>Column5</th><th>Column6</th><th>Column7</th><th>Column8</th><th>Column9</th><th>Column10</th><th>Column11</th><th>Column12</th><th>Column13</th></tr></thead><tbody><tr><td>Balance due</td><td>35000</td><td>30000</td><td>25000</td><td>21000</td><td>17000</td><td>14000</td><td>11000</td><td>8000</td><td>5000</td><td>3000</td><td>1000</td><td>0</td></tr></tbody></table>

### Explanation

As we used the current period index for Amount paid it will take Feb's value to subtract with Feb's loan amount, Mar's value to subtract with Mar's loan amount and so on.


---

# 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 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/static-identifiers/current_period_index.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.
