# Offset dates

The **Offset** date option is available when you:

* Add a user-defined period.
* Apply a custom period (in Financial Statements).
* Set the period as part of defining a measure (in Analytics Custom mode or advanced search).
* Set a defined period for a database (administrators).

The setup window might behave differently depending on where you start from, but the concept of the **Offset** date option is the same. It allows you to set a date (or date range) based on today's date. Rather than enter a fixed date range, such as *Start: January 2023 and End: March 2023*, you define a dynamic date range, such as *Year-to-date* or *Last month*, so the data continues to update.

The offset settings for the Days period type are different from those of the Months and Years, as outlined below.

## Offsets in month and year-based date ranges <a href="#offsetdates-useoffsetsmonthandyear-baseddateranges" id="offsetdates-useoffsetsmonthandyear-baseddateranges"></a>

The general steps for using the **Offset** option with Month and Year period types are:

1. Select the **Year** or **Month** period type, as required.
2. Select the **Offset** checkbox to activate the offset date setting. You can set both the **Start** and **End** dates as offsets or just one of them.&#x20;
3. Enter the offset date as a number. The timeframe is displayed in words next to the offset box.

<div align="left"><figure><img src="/files/VYjoGcyv72fT5Vm4tmCN" alt="" width="563"><figcaption></figcaption></figure></div>

The following examples (set in June 2024) are common *set-and-forget* dynamic periods you can add to your analysis using the month and year **Offset** options. As they are designed to work into the future, they’re a simple way to get a date range that updates each month or year. They save you from having to manually update the date range when you roll over into a new month, calendar year, or financial year.&#x20;

{% hint style="warning" %}
The **Most Recent** offset option sets the date as the 1st of the month, not the end. Therefore, depending on your required date range, you might need to select the following month in order to see the complete picture. For example, if you select **January** > **Most recent** to **March** > **Most recent**, the period will run from 1st January until the 1st March. If you want to include all of March in the range, you need to select April as the end month.
{% endhint %}

### Calendar year-to-date (most recent) <a href="#offsetdates-calendaryear-to-date-mostrecent" id="offsetdates-calendaryear-to-date-mostrecent"></a>

<div align="left"><figure><img src="/files/v9VDwMduHBlN0kyeyGU1" alt="image-20240606-020500.png" width="545"><figcaption></figcaption></figure></div>

1. Select the **Month** period type.
2. In the **Current Period** > **Start** date, clear the **Offset** checkbox, then select **January** and **Most recent**.
3. In the **Current Period** > **End** date, select the **Offset** checkbox and enter **0** as the offset number.
4. In the **Previous Period** > **Start** date, clear the **Offset** checkbox, then select **January** and **Second most recent**.
5. In the **Previous Period** > **End** date, select the **Offset** checkbox and enter **-12** as the offset number.

### Financial year-to-date (most recent) <a href="#offsetdates-financialyear-to-date-mostrecent" id="offsetdates-financialyear-to-date-mostrecent"></a>

For example, if your financial year runs from April to March, you can select **April** and the **Most recent** dynamic date option, along with an offset end, to always view the previous financial year’s data without having to select the year each year.

<div align="left"><figure><img src="/files/9yrMqqxHhTlnTQBRHpAg" alt="image-20240606-033432.png" width="545"><figcaption></figcaption></figure></div>

1. Select the **Month** period type.
2. In the **Current Period** > **Start** date, clear the **Offset** checkbox, then select the **Start** month of the financial year (for example, **April**) and **Most recent**.
3. In the **Current Period** > **End** date, select the **Offset** checkbox and enter **0** as the offset number.
4. In the **Previous Period** > **Start** date, clear the **Offset** checkbox, then select the **Start** month of the financial year (for example, **April**) and **Second most recent**.
5. In the **Previous Period** > **End** date, select the **Offset** checkbox and enter **-12** as the offset number.

### Last month (offset) <a href="#offsetdates-lastmonth-offset" id="offsetdates-lastmonth-offset"></a>

For example, suppose you want to view data for the last month and compare it with data for the same month in the previous year.

<div align="left"><figure><img src="/files/zROkjGvwLADNQTkVFrgO" alt="image-20240609-210002.png" width="545"><figcaption></figcaption></figure></div>

1. Select the **Month** period type.
2. In the **Current Period** > **Start** date, select the **Offset** checkbox and enter **-1** as the offset number.
3. In the **Current Period** > **End** date, select the **Offset** checkbox and enter **-1** as the offset number.
4. In the **Previous Period** > **Start** date, select the **Offset** checkbox and enter **-13** as the offset number.
5. In the **Previous Period** > **End** date, select the **Offset** checkbox and enter **-13** as the offset number.

### This month (offset) <a href="#offsetdates-thismonth-offset" id="offsetdates-thismonth-offset"></a>

For example, suppose you want to view data for this month and compare it with data from last month.

<div align="left"><figure><img src="/files/n2grjWMxaEYRI02Xk5f8" alt="image-20240609-210227.png" width="545"><figcaption></figcaption></figure></div>

1. Select the **Month** period type.
2. In the **Current Period** > **Start** date, select the **Offset** checkbox and enter **0** as the offset number.
3. In the **Current Period** > **End** date, select the **Offset** checkbox and enter **0** as the offset number.
4. In the **Previous Period** > **Start** date, select the **Offset** checkbox and enter **-1** as the offset number.
5. In the **Previous Period** > **End** date, select the **Offset** checkbox and enter **-1** as the offset number.

### Rolling 12 months (offset) <a href="#offsetdates-rolling12months-offset" id="offsetdates-rolling12months-offset"></a>

For example, suppose you want to view data for the last 12 months up to today and compare it with data from the same months in the previous year.

<div align="left"><figure><img src="/files/rwX15tvMSotrq7P616Vz" alt="image-20240609-210728.png" width="545"><figcaption></figcaption></figure></div>

1. Select the **Month** period type.
2. In the **Current Period** > **Start** date, select the **Offset** checkbox and enter **-11** as the offset number.
3. In the **Current Period** > **End** date, select the **Offset** checkbox and enter **0** as the offset number.
4. In the **Previous Period** > **Start** date, select the **Offset** checkbox and enter **-23** as the offset number.
5. In the **Previous Period** > **End** date, select the **Offset** checkbox and enter **-12** as the offset number.

### Last three years (offset) <a href="#offsetdates-lastthreeyears-offset" id="offsetdates-lastthreeyears-offset"></a>

For example, suppose you want to view data for the last three years.

<div align="left"><figure><img src="/files/jnXzyFSF42mU1Zw9CV2h" alt="image-20240606-023302.png" width="545"><figcaption></figcaption></figure></div>

1. Select the **Year** period type.
2. In the **Current Period** > **Start** date, select the **Offset** checkbox and enter **-2** as the offset number.
3. In the **Current Period** > **End** date, select the **Offset** checkbox and enter **0** as the offset number.

## Offsets in day-based date ranges <a href="#offsetdates-useoffsetsforday-baseddateranges" id="offsetdates-useoffsetsforday-baseddateranges"></a>

The general steps for using the **Offset** option with the Day period types are:

1. Select the **Day** period type.
2. Click the date box to display the options window, then select the tab of the option you want to use:

{% tabs %}
{% tab title="Actual" %}
This option does not use an offset. Therefore, the date is fixed.

Select a specific date.

<div align="left"><figure><img src="/files/WKZWozf1bxwImByAizXX" alt="" width="221"><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="Offset" %}
This option is essentially a day offset, either forward or backward from today. This option is useful, for example, to set a rolling 7-day period. See other examples below.

Enter or select a specific number of days. Alternatively, for a quicker way of getting the correct offset value here, select the date on the **Actual** tab first, then select the **Offset** tab. The offset value will match the selected date.

<div align="left"><figure><img src="/files/Yf8X2ZkT4HMWiWwxvtwW" alt="" width="223"><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="Special" %}
This option allows you to select a day that is based on a **month** offset (selecting a certain type of day in a particular month). This option is useful, for example, when analyzing the month-to-date performance (see example below).

Select one of the four **Match…** options and offset that match against a chosen month.

* **First Day**: The first day of the offset month. For example, to view the first day of three months ago, enter an offset of -3.
* **Last Day**: The last day of the offset month. For example, to view the last day of next month, enter an offset of 1.
* **Match Today**: Tries to match today's date in the offset month. For example, if today is the 13th, you’ll get the 13th of the offset month. But if today is the 29th, 30th, or 31st, and a direct match is unavailable, you'll get the closest match.\
  Other examples: To match today, enter an offset of 0, to match today last month, enter an offset of -1, and so on.
* **Match Yesterday**: Tries to match yesterday's date in the offset month. For example, if yesterday is the 12th, you'll get the 12th of the offset month. If today is the 1st, you'll get the last day of the month prior to the offset month. If yesterday is the 29th or 30th and a direct match is unavailable, you'll get the closest match.

<div align="left"><figure><img src="/files/pCxUwjGZcUdKCNrTPCQd" alt="" width="240"><figcaption></figcaption></figure></div>
{% endtab %}
{% endtabs %}

The following examples are common *set-and-forget* dynamic periods you can add to your analysis using the **Offset** option with the Day period type. As they are designed to work into the future, they’re a simple way to get a date range that updates each day.

### Month-to-date (special) <a href="#offsetdates-month-to-date-special" id="offsetdates-month-to-date-special"></a>

<div align="left"><figure><img src="/files/RM8ItciCPJzlQ4cavfqy" alt="image-20240606-021834.png" width="545"><figcaption></figcaption></figure></div>

1. Select the **Day** period type.
2. In the **Current Period** > **Start** date, select the **Special** tab, then select the **First Day** of the month and enter **0** as the month.
3. In the **Current Period** > **End** date, select the **Offset** tab, then enter **0** as the offset.
4. In the **Previous Period** > **Start** date, select the **Special** tab, then select the **First Day** of the month and enter **-1** (or -12) as the month.
5. In the **Previous Period** > **End** date, select the **Special** tab, then select **Match Today** and enter **-1** (or -12) as the month.

### Today (offset) <a href="#offsetdates-today-offset" id="offsetdates-today-offset"></a>

<div align="left"><figure><img src="/files/GbhfBwdKZFbhcOEsToFv" alt="image-20240606-035432.png" width="600"><figcaption></figcaption></figure></div>

1. Select the **Day** period type.
2. Click the **Current Period** > **Start** box, select the **Offset** tab, then enter **0** as the offset.
3. Click the **Current Period** > **End** box, select the **Offset** tab, then enter **0** as the offset.

### Yesterday (offset) <a href="#offsetdates-yesterday-offset" id="offsetdates-yesterday-offset"></a>

<div align="left"><figure><img src="/files/QaSQhMvlFotyHj2r5t96" alt="image-20240606-035501.png" width="600"><figcaption></figcaption></figure></div>

1. Select the **Day** period type.
2. Click the **Current Period** > **Start** box, select the **Offset** tab, then enter **-1** as the offset.
3. Click the **Current Period** > **End** box, select the **Offset** tab, then enter **-1** as the offset.

### Last 7 days (offset) <a href="#offsetdates-last7days-offset" id="offsetdates-last7days-offset"></a>

<div align="left"><figure><img src="/files/vZXyNFFiTkiHfREyzYQT" alt="image-20240606-035756.png" width="600"><figcaption></figcaption></figure></div>

1. Select the **Day** period type.
2. Click the **Current Period** > **Start** box, select the **Offset** tab, then enter **-6** as the offset.
3. Click the **Current Period** > **End** box, select the **Offset** tab, then enter **0** as the offset.


---

# 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.phocassoftware.com/basics/getting-started/periods/offset-dates.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.
