# Rearranging Example

## Setup

For our forecast periods (2023 onwards), we want to calculate `Revenues` <mark style="color:green;">**(1)**</mark> as an output, so we start with a simple calculation, `Revenues = Widgets Sold * Price` <mark style="color:green;">**(2)**</mark>.

<figure><img src="/files/K5286a0QCFwz2V5d9c6d" alt=""><figcaption><p><code>Revenues</code> Variable before rearranging</p></figcaption></figure>

We set up our `Widgets sold` Variable so that we need to enter [**Assumptions**](/assumptions/introduction-to-assumptions.md) for 2021 and 2022 <mark style="color:green;">**(3)**</mark>, and from 2023 onwards `Widgets sold` will be equal to the previous period <mark style="color:green;">**(4)**</mark>. However, we don't know how many Widgets were sold in 2021 and 2022, so we cannot initially calculate `Revenues`, meaning we have blank values in our output <mark style="color:green;">**(5)**</mark>.

<figure><img src="/files/hj44oNleu1zYOJ8F56Sr" alt=""><figcaption><p><code>Widgets sold</code> Variable before rearranging</p></figcaption></figure>

## Entering Actual Revenues

We know what our revenues were for 2021 and 2022, so we create a [**new Time Segment**](/variables/time-segments/time-segment-setup.md#creating-editing-time-segments) in our `Revenues` Variable <mark style="color:green;">**(6)**</mark>, with an `Assumptions` [**formula type**](/variables/time-segments/time-segment-setup.md#formula), and add our historical revenues data to this Time Segment.

<figure><img src="/files/E6PfN2eTRS6XCtkIB810" alt=""><figcaption><p><code>Revenues</code> Variable after entering Assumptions for 2021 and 2022</p></figcaption></figure>

Models now sees that for 2021 and 2022, it is expecting input data for all three Variables, `Revenues`, `Widgets sold` and `Price`. This is not a valid state, as in any [**Calculation**](/calculations/introduction-to-calculations.md) there must be exactly one unknown Variable to be calculated, otherwise there is the potential for conflicts (i.e. we could enter values for the three Variables that do not match the Calculation `Revenues = Widgets sold * Price`).

To rectify this, Models displays a message on the first Time Segment of `Revenues` <mark style="color:green;">**(7)**</mark>, warning that a "Child needs to be rearranged for this segment". We can read this as saying that one of the input Variables, `Widgets Sold` or `Price` needs to become the output of the Calculation to maintain logical consistency.

## Rearranging

To rearrange the segment, we simply click the **Resolve** <img src="/files/VQ2P2SvZhGCPaMG3mNi6" alt="" data-size="line">button <mark style="color:green;">**(8)**</mark>, which opens a new dialog, shown below.

We are offered a choice of child Variables to rearrange. We need to select the Variable that we want to be used as the new output of the Time Segment. In this case, we know the price, but we don't know the number of widgets sold, so we select `Widgets sold` as the new output <mark style="color:green;">**(9)**</mark>.

<figure><img src="/files/ZSz8zVHhL84kAAIrtNxJ" alt=""><figcaption><p>Rearranging dialog</p></figcaption></figure>

This results in the below state, where we no longer have warnings in our Variables. The first Time Segment for `Widgets sold` has been rearranged, with a Calculation of `Revenues / Price` <mark style="color:green;">**(10)**</mark>.

<figure><img src="/files/tDdDtOvzu4z37KDiDj1i" alt=""><figcaption><p><code>Widgets sold</code> Variable after rearranging</p></figcaption></figure>

`Widgets sold` is now calculated from `Revenues` and `Price` for 2021 and 2022, and is static thereafter.&#x20;

{% hint style="info" %}
Note that the **Values** table visually indicates the change in calculation method with a border to the right of the 2022 period <mark style="color:green;">**(11)**</mark>.
{% endhint %}


---

# 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://help.taglo.io/rearranging/rearranging-example.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.
