# Rearranging Tips

## Cascading rearranged Variables

In the [**previous section's**](/rearranging/rearranging-example.md) 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="/files/dABoybRBJ21Dpm3Cs7qL" 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="/files/8WVJjJQDq5k7duqevSOL" 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="/files/OS1quW4srjaxtqqVtK3f" 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="/files/VQ72Va0hTPJBACMq3LJ6" 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="/files/JWkjlWAoXD2GqCBFijdu" alt=""><figcaption><p><code>Widgets sold</code> Variable after reversing relationship with <code>Revenues</code></p></figcaption></figure>

<figure><img src="/files/eVm9xJnw9ze5LpIFSQxv" 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`.


---

# 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-tips.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.
