# Change the period

{% hint style="success" %}
Periods are a core concept in Phocas. Read the [Periods](https://app.gitbook.com/s/7pj8v25BOyqZTdG5mdD1/getting-started/periods) page to learn more about the **Period** menu and the different types of periods.
{% endhint %}

{% hint style="info" %}
The [Reset tool](https://docs.phocassoftware.com/analytics/reset-data) does not work for the Period menu.
{% endhint %}

## Apply a defined period <a href="#changetheperiod-inanalytics-applyadefinedperiod" id="changetheperiod-inanalytics-applyadefinedperiod"></a>

You use the **Period** menu to change the timeframe that applies to the data in the grid.&#x20;

Click the **Period** menu to view the list of defined periods, then select the one you want to apply. The grid updates automatically.

<div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/tgBhNE4jE0AQndIDjscX/3235447517.png" alt="" width="365"><figcaption></figcaption></figure></div>

{% embed url="<https://phocassoftware.wistia.com/medias/unehka64ix>" %}
Select and change periods
{% endembed %}

## Check what dates are used in a defined period <a href="#changetheperiod-inanalytics-checkwhatdatesareusedinadefinedperiod" id="changetheperiod-inanalytics-checkwhatdatesareusedinadefinedperiod"></a>

During your analysis, you might wonder why you do not see certain data in the grid. A common reason for missing data is that the data is not represented in the period that is currently applied to the grid. You should check the dates in the period to ensure the data you are looking for is within that range. If it is not, you can change the period to view the required data.

There are two ways you can find out the date range for a particular defined period:

* Apply the period, then click the **Information** button in the top right toolbar. The period details display in the **Information** window. Click **Close** to return to your analysis.

  <div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/fdEJjUTZxwu7Sh15lGsF/3235414811.png" alt="" width="534"><figcaption></figcaption></figure></div>
* (If you have permission) Apply the period, then when the grid updates, click the **Period** menu and select **Custom**. The **Custom Period** window displays the dates for that period. Click **Close** to return to your analysis.

  <div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/HBxQcIupKpwOBHhe9GXw/3235447523.png" alt="" width="427"><figcaption></figcaption></figure></div>

## Apply a custom period <a href="#changetheperiod-inanalytics-applyacustomperiod" id="changetheperiod-inanalytics-applyacustomperiod"></a>

{% hint style="info" %}
User permission: Query > Apply Custom Period
{% endhint %}

{% embed url="<https://phocassoftware.wistia.com/medias/y3p1iamfd4>" %}
Create a custom period in Analytics
{% endembed %}

1. Click the **Period** menu and select **Custom**.
2. In the **Custom Period** window, select the period type (time unit), such as year, month or day. The period types that are available depend on what was set up by your administrator when the database was created.
3. (Optional) Select the **Reversed** checkbox. By default, time units (years, months, weeks or days) display in the grid in chronological order from left to right. To avoid having to scroll across to the most recent time unit, you can reverse the display order.
4. Select a start and end date for your current period. The previous period automatically updates accordingly (one year earlier) but you can change those dates too, if required.
5. Click **Apply**. The **Custom** option displays in the **Period** menu and the grid updates to display the data for that period. The period range you set displays in the status bar above the grid.&#x20;

   <div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/Jm83ZN9u2093waoDm4Tu/3235447529.png" alt="" width="267"><figcaption></figcaption></figure></div>
6. (Optional) Save the results as a favorite to include the custom period.

<details>

<summary>Example 1: View a range of months</summary>

Apply a custom period in the Purchases database to identify customers who have purchased products during the summer season (in the northern hemisphere).

1. Select the **Customer** dimension.&#x20;
2. Ensure you are in Period mode, then click **Period** > **Custom**.
3. In the **Custom Period** window, select **Month** and set the Current period start date to June and the end date to August. The Previous period will default to June to August in the previous year.
4. Click **Apply**. The grid updates to display only customers who purchased products during the summer. The columns will be June, July and August, from left to right (unless you selected the **Reverse** option) and the date range displays in the status bar.

</details>

<details>

<summary>Example 2: Compare data for sections of months</summary>

Apply a custom period in the Sales database to compare products sales for the first half of October compared with the first half of September.

1. Select the **Product** dimension.&#x20;
2. Ensure you are in Period mode, then click **Period** > **Custom**.
3. In the **Custom Period** window, select **Day**.
4. Set the Current period start date to 1 October 2022 and the end date to 16 October 2022.
5. Set the Previous period start date to 1 September 2022 and the end date to 16 September 2022.
6. Click **Apply**. The grid updates to display all products sold during the first half of October (Current Period column) and the first half of September (Previous Period column) and the date range displays in the status bar.

</details>

<details>

<summary>Example 3: View one month at a time</summary>

To view a single month, the start and end need to be the same, as illustrated in the image below.&#x20;

<img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/FuN0iH9jYSoXsgYlxaUU/3235447535.png" alt="" data-size="original">

</details>

## Add your own defined period <a href="#changetheperiod-inanalytics-addauser-definedperiod" id="changetheperiod-inanalytics-addauser-definedperiod"></a>

{% hint style="success" %}
If you think your defined period would be useful to other users, ask your administrator to set a new period type in the database, so all users (provided they have permission) can see it in the **Period** list.
{% endhint %}

{% hint style="info" %}
User permissions: Query > Apply Custom Period and Save User Defined Period
{% endhint %}

You can add your own user-defined period from scratch or tweak an existing defined period, then add it as a new defined period. Either way, as it is your defined period, you can edit or delete it as required.

{% embed url="<https://phocassoftware.wistia.com/medias/npkfb5mmc0>" %}
Add user-defined periods
{% endembed %}

### Add a user-defined period from scratch <a href="#changetheperiod-inanalytics-addauser-definedperiodfromscratch" id="changetheperiod-inanalytics-addauser-definedperiodfromscratch"></a>

1. Click the **Period** menu and select **Add** at the bottom of the list.
2. In the **User Defined Period** window, enter a name for the period.
3. Select the period type (time unit), such as year, month, or day. The available period types depend on what your administrator set up when the database was created. You will typically see year, month, and day, but week and quarter are also common.
4. (Optional) Select the **Reversed** checkbox. By default, time units (years, months, weeks, or days) display in the grid in chronological order from left to right. To avoid having to scroll across to the most recent time unit, you can reverse the display order.
5. Select the start and end dates for your Current and Previous periods.
   * When you set up the Current period date range, the Previous period automatically updates accordingly (one year earlier), but you can change that too, if required.
   * When defining a date range based on months, you can select either a month in a fixed year or one of two dynamic options: **Most recent** (the past 12 months) or **Second most recent** (the 12 months prior to that). Using a dynamic option is a simple way to get a date range that updates each year, and it saves you from having to manually update dates when you roll over into a new calendar or financial year. For more information and examples, see the [Offset dates](https://app.gitbook.com/s/7pj8v25BOyqZTdG5mdD1/getting-started/periods/offset-dates) page.

     <div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/zYI1uuMgAUsJY78gSbUN/3235447541.png" alt="" width="156"><figcaption></figcaption></figure></div>
   * To define a date range based on today's date so that the data continues to update dynamically, use an offset date.

     <div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/IThxQX9InM5Fh9Ox8PJX/3235447547.png" alt="" width="340"><figcaption></figcaption></figure></div>
6. Click **Save & Apply**. The new period displays in the **Period** list and the grid updates to display the data for that period.

   <div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/Wqe4VDtVJ8SMSM3O6D69/3235447553.png" alt="" width="374"><figcaption></figcaption></figure></div>

### Add a user-defined period based on an existing period <a href="#changetheperiod-inanalytics-addauser-definedperiodbasedonanexistingperiod" id="changetheperiod-inanalytics-addauser-definedperiodbasedonanexistingperiod"></a>

You can use a period you have already created as the basis for another period. This is useful if you want to make a small change, as it saves you time.

1. Click the **Period** menu and select the defined period from the list.&#x20;
2. When the grid updates with the new defined period, click **Period** > **Add**.
3. In the **User Defined Period** window, enter a name for the period.
4. Adjust the dates as required.
5. Click **Save & Apply**. The new period displays in the **Period** list and the grid updates to display the data for that period.

### Edit or delete a user-defined period <a href="#changetheperiod-inanalytics-editordeleteauser-definedperiod" id="changetheperiod-inanalytics-editordeleteauser-definedperiod"></a>

You can change the setup of a defined period you add, or delete it if you no longer need it.

Click the **Period** menu and locate the period in the list, then either:

* Click the **Edit** button next to the period name, make your changes and click **Save & Apply**. Any existing favorites or widgets will update to reflect the changes.
* Click the **Delete** button next to the period name and click **Yes** to confirm. The period disappears from the **Period** list.
