# Time Segment Setup

## Creating/Editing Time Segments

Time Segments are managed in the Time Segments step of the **Variable** dialog.

<div data-full-width="false"><figure><img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2FnNJMJVgsfV3Z8gHA7TAc%2Fimage.png?alt=media&#x26;token=0924f0af-5679-4d2c-9380-e681d812b3f7" alt="Screenshot of the Time Segments step of the Variables wizard"><figcaption><p>Time Segment step of the Variable dialog</p></figcaption></figure></div>

You can add, edit and duplicate Time Segments just like any other item in a [**list view**](https://help.taglo.io/using-taglo-software/the-taglo-interface/list-views).

## The Time Segment Wizard

### Timings

You must define the time period over which each Time Segment applies. This time period is defined in terms of three settings:

1. **From**: The period at which the segment starts
2. **Duration**: The length of the segment
3. **To**: The period at which the segment ends

As shown in the screenshot below, these settings can be quickly edited by clicking on the relevant editing shortcut button <img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2Fpx4o9khfY6Np9Oovyef6%2Fimage.png?alt=media&#x26;token=cee17f0b-c584-4df6-8da4-9d31072fc5c0" alt="" data-size="line">.

<figure><img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2FAzsvvD0cPBZDy9QrUj2n%2Fimage.png?alt=media&#x26;token=94e21f5a-7376-4c35-bd5a-1f945189ea59" alt="Screenshot showing two Time Segments with timings editing shortcut buttons highlighted"><figcaption><p>Timings editing shortcuts </p></figcaption></figure>

**From** and **To** settings can be set to one of the following:

<table><thead><tr><th width="241">From/To setting</th><th>Details</th></tr></thead><tbody><tr><td><code>Auto</code></td><td><p>Period dependent on context:</p><ul><li>If first segment, From will be set to the start of the model</li><li>If last segment, To will be set to the end of the model</li><li>If other, From/To will be based on end or beginning of adjacent segments).</li></ul></td></tr><tr><td><code>Fixed Period</code></td><td>Choice of specific periods from the Model timings (e.g. Q2 2030)</td></tr><tr><td><code>Periods from Start</code></td><td>Number of periods from start (first period = 1 )</td></tr><tr><td><code>Periods from End</code></td><td>Number of periods from end (last period = 1)</td></tr></tbody></table>

**Duration** can be set to one of the following:

<table><thead><tr><th width="242">Duration setting</th><th>Details</th></tr></thead><tbody><tr><td><code>Fill</code></td><td>Segment will stretch to end of previous period and beginning of next (or to start/end of the model if first/last segment)</td></tr><tr><td><code>Number of periods</code></td><td>Segment will occupy the specified number of periods</td></tr></tbody></table>

{% hint style="warning" %}
You should apply a **maximum of 2** of the three settings. Which settings are applied depends on the Time Segment.&#x20;

For instance, the first Time Segment never needs to have the **From** setting applied, as it always starts at the first period. If you set **From** to a period that is not the first period, a warning will be shown.

Likewise, if you set both the **Duration** and the **To** settings of the first Time Segment, one of these will be redundant, and they may clash.
{% endhint %}

### Formula

The **Formula** of a Time Segment determines how that Time Segment calculates its values.

There are five possible formula types for each Time Segment:

<table><thead><tr><th width="169">Formula Type</th><th>Details</th></tr></thead><tbody><tr><td><code>Auto</code></td><td>Applies the default <a href="../../calculations"><strong>Calculation</strong></a> of the Variable. (This option is not available for an <a href="../../variable-basics/variable-setup#variable-type"><strong>Assumptions Type</strong></a> Variable).</td></tr><tr><td><code>Assumptions</code></td><td>Links to specific <strong>Assumptions</strong>. See <a href="../../assumptions/creating-referencing-assumptions"><strong>Creating/Referencing Assumptions</strong></a> for more details.</td></tr><tr><td><code>Calculation</code></td><td>Applies a custom Calculation that cannot refer to other Variables. (See more details below).</td></tr><tr><td><code>Aggregation</code></td><td><p>Used for an <a href="../../aggregation"><strong>Aggregation</strong></a> Variable.</p><p></p><p><em>Cannot be manually selected - applied automatically when using Aggregation.</em></p></td></tr><tr><td><code>Rearranged</code></td><td><p>Used when <a href="../../rearranging"><strong>Rearranging</strong></a>.</p><p></p><p><em>Cannot be manually selected - applied automatically when Rearranging</em></p></td></tr></tbody></table>

#### Calculation Formula

<figure><img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2FIiNPuUe93vK6vg04NrWo%2Fimage.png?alt=media&#x26;token=b994cbf7-4726-4edc-8b20-0ddd606847ab" alt="Screenshot showing a Variable where the second time segment is set to a Calculation formula, referencing the previous period"><figcaption><p>Example of Calculation Formula</p></figcaption></figure>

As shown in the above example, a Time Segment with a Calculation formula acts similarly to an Assumptions Time Segment.

In this example, `Price inflation` is a Variable of type `Assumptions`. In the first period, an Assumptions Time Segment links to an input. We then use a Calculation Time Segment for the remaining periods to reference the previous period, rather than linking to specific Assumptions for each period of the Model.

{% hint style="info" %}
`Calculation` Time Segments act similarly to `Assumptions`, in that they specify an **input** to the Model. For this reason, calculations in Time Segments cannot reference other Variables.

If you want to perform a calculation referencing other Variables, the Variable itself must be of type `Calculation.`

If you are not sure when to use Assumption/Calculation Variables and Assumption/Calculation Time Segments, you may want to read about the [**Rearranging feature**](https://help.taglo.io/rearranging/rearranging-example), which helps deal with complex scenarios.
{% endhint %}

## Time Segment shortcuts

<figure><img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2FcQQk2aD8BB8YWQz3xXjC%2Fimage.png?alt=media&#x26;token=b03e7f9a-2c86-4cb4-935b-7f549a9282e9" alt="Screenshot showing the Time Segments step of the Variable wizard, highlighting the shortcut buttons used for editing Time Segments"><figcaption><p>Time Segment shortcuts</p></figcaption></figure>

Several shortcuts are provided in the Time Segment interface to speed up some common operations, as shown in the image above.

<table><thead><tr><th width="222">Shortcut</th><th>Details</th></tr></thead><tbody><tr><td>1) Insert period</td><td>Inserts a period of duration <strong>1 period</strong> at the start of the Model</td></tr><tr><td>2) Make all equal to first period</td><td>Inserts a single period segment of type <code>Assumptions</code> at the start of the Model, and a second segment with a <code>Calculation</code> of <code>Variable [-1]</code> for the rest of the Model timings (as per the example shown in the image above).</td></tr><tr><td>3) Change formula type</td><td>Opens a dropdown to quickly switch between formula types.</td></tr><tr><td>4) Reset to default segment type</td><td>For a <strong>Calculation</strong> Variable, resets Time Segment to <code>Auto</code>. For an <strong>Assumptions</strong> Variable, resets Time Segment to <code>Assumptions</code>.</td></tr></tbody></table>
