> For the complete documentation index, see [llms.txt](https://docs.inforiver.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inforiver.com/~/changes/mS6jwvARNLHpKqBa4cT9/working-with-inforiver/4.-adding-business-logic-and-formulae/insert-calculated-rows/template-rows.md).

# Template rows

Inforiver allows inserting calculated rows at every level in the hierarchy with the template row option.

{% embed url="<https://lumel.wistia.com/medias/n67puv7p0m>" %}

Let us take this example: Sales data by region and category. Let's insert a calculated row in each hierarchy which is 1.5 times the value of Beverages across quarters.

a) Select a row above which you would like to insert the row.

b) In the 'Insert' tab of the toolbar, click on the ‘Insert row' dropdown and select the 'Template row' option.

<figure><img src="/files/mjiysgi2mNHRThwj4ROV" alt=""><figcaption><p>Insert template row</p></figcaption></figure>

c) A new row gets inserted and the 'Template row' side panel opens.

<figure><img src="/files/XlbQDozT6Q8U7ebI6TaJ" alt=""><figcaption><p>Template row side panel</p></figcaption></figure>

d) Enter the 'title' and insert the required 'formula'. Refer to [calculated rows](/~/changes/mS6jwvARNLHpKqBa4cT9/working-with-inforiver/4.-adding-business-logic-and-formulae/insert-calculated-rows.md) for more details on using the formula editor.

<figure><img src="/files/zKN4b0JFLLOWbr44Swy0" alt=""><figcaption><p>Title &#x26; formula</p></figcaption></figure>

e) Select the 'Row position' as ‘First’, ‘Auto’ or ‘Last’ from the drop-down.

'First' - the template row will be placed first at the category level, irrespective of where it is added

'Auto' - the template row is placed above the selected row where it is added

'Last' - the template row is placed last at the category level, irrespective of where it is added

<figure><img src="/files/K4L0mVfvT8ibo8S5pj1a" alt=""><figcaption><p>Row position</p></figcaption></figure>

f) You can select the 'Apply the same style to all rows' checkbox if you want to replicate the same formatting to all of the rows. For example, let's apply a background color for the row.

<figure><img src="/files/KoANcIn6kGpRVw5dmmfY" alt=""><figcaption><p>Format style applied</p></figcaption></figure>

g) To include the row value in subtotals and totals, check the 'Include in total' check box.

<figure><img src="/files/shy6dyZ2ZLjubAagrLo2" alt=""><figcaption><p>Include total</p></figcaption></figure>

h) If charts are added to the table, the 'Include in charts' option allows you to visualize the calculated rows as well using charts.

{% hint style="info" %}
The 'Include in charts' checkbox is enabled only when the 'Include in total' option is unchecked.
{% endhint %}

i) If the 'Evaluate columns before rows' checkbox is enabled, the defined formula is used for calculating the column totals. If this check box is disabled, then sum aggregation is followed fo the column totals. To learn more, refer [Evaluate columns before rows](https://inforiver.gitbook.io/inforiver/working-with-inforiver/4.-adding-business-logic-and-formulae/insert-calculated-rows#4.-evaluate-column-before-rows).

j) You can add a description for the formula if needed. Click 'Create'.

<figure><img src="/files/LSHMyhYd0w6AuYseczqm" alt=""><figcaption><p>Create template row</p></figcaption></figure>

k) The row gets created at the category level for all the subregions as shown.

<figure><img src="/files/ElLbCVL6vusukIfdWzwP" alt=""><figcaption><p>Template rows</p></figcaption></figure>

l) The below image shows another example, where the rows 'Extra Large' are defined as the previous month's value for the size 'Large'. To learn more about the formula used, refer to [RELATIVE\_COLUMN](/~/changes/mS6jwvARNLHpKqBa4cT9/formula-syntax/identifiers/relative_column.md).

<figure><img src="/files/YnHUcJ3ic8AbuyAzuAlO" alt=""><figcaption><p>Template rows</p></figcaption></figure>

m) You can edit/delete the inserted template row by clicking on the row gripper of the selected template row and choosing the respective option from the drop-down.

<figure><img src="/files/MgELmN9VLg78JC6Bwmnr" alt=""><figcaption><p>Edit &#x26; delete template row</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/~/changes/mS6jwvARNLHpKqBa4cT9/working-with-inforiver/4.-adding-business-logic-and-formulae/insert-calculated-rows/template-rows.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.
