# GETCOLBETWEENPERIODS

The GETCOLBETWEENPERIODS function can be used to select data from a given measure, for a specified period. It should be used with an aggregate function like SUM or AVERAGE.&#x20;

## Syntax

```javascript
GETCOLBETWEENPERIODS(fromDate, toDate, measures)
```

## Arguments

fromDate– The starting period from when data is to be fetched. Required.

toDate– The end period till when data is to be fetched. Required.

measures - Specify the measures for which to fetch data. Leaf-level measures will be taken if measures are not explicitly specified. Optional.

## Return value

Range of data.

## Example

```javascript
GETCOLBETWEENPERIODS(DATE.ADDMONTH(-6), DATE.ADDMONTH(2), [[Profit]])
//Returns the profit measure for the specified date range 
```

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2Fgz0xhPJ1ajIqJe9pFYkl%2Fimage.png?alt=media&#x26;token=4ebe2015-a5b2-4a1d-a463-e5a21da08b2d" alt=""><figcaption><p>Getcolbetweenperiods</p></figcaption></figure>
