# QTRPERIOD

The **QTRPERIOD** function can be used to select data from a given measure for a particular quarter or a range of quarters. It should be used in conjunction with the SELECT clause and with an aggregate function like SUM or AVERAGE.&#x20;

## Syntax

```javascript
QTRPERIOD(year, from_quarter, to_quarter)
```

## Arguments

year – The year for which data has to be fetched. Required.

from\_quarter – The quarter for which data has to be fetched or the start quarter if a range is specified. Values can be between 1 and 4. Required.

to\_quarter - The end quarter when a range of data has to be fetched. Values can be between 1 and 4. Optional.

## Return value

Period Range.

## Example

```javascript
QTRPERIOD(2023,1,3) 
//Returns data from the first to the third quarter of 2023
QTRPERIOD(2023,4)
//Returns data for the fourth quarter of 2023
```

<figure><img src="/files/YS5Etp31KIGJTyVE5iKy" alt=""><figcaption><p>Quarter period without offset</p></figcaption></figure>

<figure><img src="/files/ioGV36wVUA67R1eTekjq" alt=""><figcaption><p>Quarter period with offset</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/time-intelligence-functions/qtrperiod.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.
