> 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/range-functions/getcurrentrange.md).

# GETCURRENTRANGE

The GETCURRENTRANGE funtion returns a range of value based on active period and period selection.

### Syntax

DS.(SERIES).GETCURRENTRANGE()

### Example

Consider the below table that has Sales values for all months in a year. Our objective is to find the Quarter-1 Sales value.

<table><thead><tr><th width="83">Periods</th><th width="83">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;">Sales</mark></td><td>845</td><td>122</td><td>561</td><td>681</td><td>594</td><td>842</td><td>1153</td><td>674</td><td>951</td><td>154</td><td>214</td><td>854</td></tr></tbody></table>

To get the value of First Quarter sales, we should first set the Value display as Sim.Months and keep Jan to Mar as the Simulation Period. Then give the formula as:

<mark style="color:blue;">**`SUM`**</mark>**`(`**<mark style="color:blue;">**`DS`**</mark>**`._Sum_of_2023.`**<mark style="color:purple;">**`[Sales]`**</mark>**`.`**<mark style="color:blue;">**`GETCURRENTRANGE`**</mark>**`())`**

{% hint style="info" %}
Change the Sim.Months according to the values you want to achieve. If you want to get Q4 Sales you should set the Sim.Months as Oct to Dec.
{% endhint %}

### Result

<table data-header-hidden><thead><tr><th width="271"></th><th></th></tr></thead><tbody><tr><td>Q1 Sales</td><td>1528</td></tr></tbody></table>


---

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