# 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: 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/getcurrentrange.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.
