# Rearranging Tips

## Cascading rearranged Variables

In the [**previous section's**](https://help.taglo.io/rearranging/rearranging-example) simple walkthrough, we only have three Variables, `Revenues`, `Widgets sold`, and `Price`.

Most situations are more complex than this: for instance, take the example below, where `Widgets sold` incorporates an inflation Calculation (`Widgets sold = Widgets sold [-1] * (1 + Widget sales yearly increase)`.&#x20;

<figure><img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2FAs2yCx0jpKqsSQaE6Grd%2Fimage.png?alt=media&#x26;token=d3136421-b9eb-4e93-b1ed-53a96a8cb43a" alt=""><figcaption><p><code>Revenues</code> Variable before rearranging</p></figcaption></figure>

We see the same warning in the `Revenues` as previously <mark style="color:green;">**(1)**</mark>: we need to rearrange a child. However, this time, when we rearrange `Widgets sold`, we see a similar warning in `Widgets sold`, as shown below <mark style="color:green;">**(2)**</mark>.

<figure><img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2FK8NUjxGWedQJ618NofAm%2Fimage.png?alt=media&#x26;token=8b63054f-0fa9-4926-9805-331ff5090dea" alt=""><figcaption><p><code>Widgets sold</code> Variable after rearranging</p></figcaption></figure>

Models is telling us that now we are calculating `Widgets sold` from `Revenues` and `Price`, we cannot also calculate it from the inflation calculation. Therefore we must rearrange `Widget sales yearly increase`, which can be calculated from the actual values of `Widgets sold` in 2021 and 2022.

This results in the below output with `Widget sales yearly increase` also rearranged <mark style="color:green;">**(3)**</mark>.

<figure><img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2FVcjKt7EBadtaFTm4CLFl%2Fimage.png?alt=media&#x26;token=b72160cb-d95a-48a7-880d-eba245af8b90" alt=""><figcaption><p><code>Widget sales yearly increase</code> after rearranging</p></figcaption></figure>

In this way, rearranged Variables cascade down to the "bottom" of the Model, or the point at which there are no more Calculations to rearrange.

## Reversing relationships

Models allows you to quickly change the direction of calculation flows if you change the desired output of a Model.

Take the below example, where we have set our Model up with `Revenue` as the output from the two input Variables, `Widgets sold` and `Price`.

<figure><img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2FKTuTtcMoiJ2AXAnWMJHh%2Fimage.png?alt=media&#x26;token=9444043f-545c-4288-827a-ad6246279a99" alt=""><figcaption><p><strong>Reverse relationship</strong> button</p></figcaption></figure>

If we select both <mark style="color:green;">**(1)**</mark> the `Revenues` Variable, and one of its child Variables (in the example above, `Widgets sold`), we are offered the option to reverse their relationship, using the **Reverse relationship** button <mark style="color:green;">**(2)**</mark>.

This results in the below:

<figure><img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2F9nirbWdJv11gYqo8Kqur%2Fimage.png?alt=media&#x26;token=091bed5e-15b2-4fb1-865b-5360bed66776" alt=""><figcaption><p><code>Widgets sold</code> Variable after reversing relationship with <code>Revenues</code></p></figcaption></figure>

<figure><img src="https://2847533834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVy65sax6FVoNo2UTlJ0x%2Fuploads%2FKwmb1j2lrlbOOzlwTNNE%2Fimage.png?alt=media&#x26;token=35326166-c4f8-4c81-a8ac-85a61522c0f7" alt=""><figcaption><p><code>Revenues</code> Variable after reversing relationship with <code>Widgets sold</code></p></figcaption></figure>

`Widgets sold` has been converted to a Calculation Variable with Calculation `Revenues / Price` <mark style="color:green;">**(3)**</mark>. `Revenues` has been converted to an Assumptions Variable where the second Time Segment is now rearranged <mark style="color:green;">**(4)**</mark> to its original Calculation of `Price * Widgets sold`.
