# Quick formula

Inforiver provides several one-click calculations for inserting columns and rows.

### 1. Quick formula

Columns/measures such as running total, % contribution to parent/grand total, etc. can be inserted in a single click. These options can be accessed from the Insert tab > Quick formula.

<figure><img src="/files/G4AnDGhsTpNBkC1x8Vkq" alt=""><figcaption><p>Quick formulas in Inforiver</p></figcaption></figure>

When you write custom formulas, you can also reference quick formula measures in them.

<figure><img src="/files/MaKTaamPNDMLYP5N8tV9" alt=""><figcaption></figcaption></figure>

#### i) Running total

The following configuration options are available for 'Running total'.&#x20;

Insert as - The running total can be inserted as a [measure or column](https://docs.inforiver.com/working-with-inforiver/4.-adding-business-logic-and-formulae/pages/ikgtokcJ0oes0aCiLKJA#2.-measure-vs-column).

Based on Measure - Column/measure based on which the running total needs to be calculated.

<figure><img src="/files/9uIdeMoH3eAxysjGxGoC" alt=""><figcaption><p>Running total for Actuals </p></figcaption></figure>

If you want to calculate the running total for all leaf nodes,  irrespective of the level of the hierarchy they belong to, select the 'Continuous Total'  checkbox.

<figure><img src="/files/0fCdw0wjNHv39df3rcxl" alt=""><figcaption><p>Continuous running total for hierarchical datasets</p></figcaption></figure>

#### ii) Percentage running total

This formula is a variant of the running total quick formula. The running total is first calculated in the background at each level of the hierarchy, after which it is displayed as a percentage of the total/subtotal.

<figure><img src="/files/9JYsRm8SPDzZWA0j2LAe" alt=""><figcaption><p>Percentage running total formula</p></figcaption></figure>

#### iii)  %Growth/Decline

This option allows you to insert visual measures or a column that calculates the required percentage growth or decline of the chosen measure.

<figure><img src="/files/ON9mAGy9iw8lyq0Vnid8" alt=""><figcaption><p>%Growth/Decline</p></figcaption></figure>

#### iv) % Contribution to parent

Use this option to quickly calculate each member's contribution to their parent's total value. In addition to choosing to insert as a visual measure/column and the base value, a progress bar can be enabled along with a percentage and/or value to display.&#x20;

<figure><img src="/files/rbEqvMP1P0bkRGiMDY8K" alt=""><figcaption><p>% Contribution of 2022 Actuals to parent</p></figcaption></figure>

#### v) % Contribution to grand total

Contribution to the grand total can be inserted as shown below. To insert % contribution only for a selected category instead of all the categories or only for the column grand total, choose the 'Visual column' option and the corresponding column.&#x20;

<figure><img src="/files/zGH86G16ZXLk8NIHRoJs" alt=""><figcaption><p>% Contribution to grand total as visual column</p></figcaption></figure>

#### vi) Lead/lag

You can perform a lead /lag calculation to shift any trend data by 'n' periods. This helps you quickly perform downstream variance calculations such as QoQ growth, YoY growth, etc. for each period.

<figure><img src="/files/uN1Rg7GxcbMiqGrA5NHr" alt=""><figcaption><p>Lead/lag calculations</p></figcaption></figure>

#### vii) Overall ranking

Ranks can be added across different groups in a single click. Choose to insert as a measure or column and the base measure. Note that there are no ranks applied for the subtotals.&#x20;

<figure><img src="/files/b1ts0YgCiwyeeqk8BTyE" alt=""><figcaption><p>Overall ranking</p></figcaption></figure>

#### viii) Ranking within a group

Ranks within groups can be added including ranks for subtotals as shown in the below image.

<figure><img src="/files/F13bZVXxcW6zC7nqS0TP" alt=""><figcaption><p>Ranking within group</p></figcaption></figure>

#### ix) Insert variance

The default variance calculated by Inforiver is based on the first measure added to the AC/PY/PL/FC fields. *Insert Variance* can be used to calculate the variance between any native measures, simulations, or formula fields in your report.

<figure><img src="/files/eNIV0B50eWX9ll5AiwMt" alt=""><figcaption><p>Insert variance</p></figcaption></figure>

#### x) Empty Column

This option allows you to insert an empty column into the report to improve readability and visual appeal. Values cannot be entered in this column.

<figure><img src="/files/6BLqvtB7tKu2sMvrZCNv" alt=""><figcaption><p>Empty Column</p></figcaption></figure>

#### xi) Empty Measure

This option allows you to insert empty measures into the report to improve readability and visual appeal. Values cannot be entered in these measures.

<figure><img src="/files/aDoQKNifjpDmnS9oDWRX" alt=""><figcaption><p>Empty Measure</p></figcaption></figure>

### 2. Smart analysis

% contribution and variance % columns can be added in a single click based on any cell in the visual. These can be accessed in the Insert tab -> Smart analysis as shown below.

{% hint style="info" %}
You need to select a cell to enable the 'Smart analysis' option.
{% endhint %}

<figure><img src="/files/1TZkk3tMV8YnJKFkdgjn" alt=""><figcaption><p>Smart analysis</p></figcaption></figure>

In the below image, % contribution has been added based on 2022 Actuals -> East.&#x20;

<figure><img src="/files/ap3LE9b8A7pKTgTLbeOw" alt=""><figcaption><p>Smart analysis - Contribution</p></figcaption></figure>

In the below image, % variance has been added based on the grand total. But you can choose any other value as well. Note that the calculation gets added as a measure or column based on the presence of categories in the column field.

<figure><img src="/files/RDm9nqMrBvfVR1gjIqEY" alt=""><figcaption><p>Smart analysis - Variance </p></figcaption></figure>

### 3. % Contribution rows

% Contribution based on any row can be inserted in a single click. To achieve this, in the Insert tab-> Insert row, select '% Contribution row'.

{% hint style="info" %}
Select a row to enable the 'Insert row' option.
{% endhint %}

<figure><img src="/files/sqGbaeDpAeaS0evbQx67" alt=""><figcaption><p>% Contribution row</p></figcaption></figure>

The % contribution row gets added as shown below.

<figure><img src="/files/fLJOevhww7HMFMp4Mc0h" alt=""><figcaption><p>% Contribution row added</p></figcaption></figure>


---

# 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://docs.inforiver.com/working-with-inforiver/4.-adding-business-logic-and-formulae/quick-formula.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.
