# Template rows (Reporting Matrix)

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

**STEP 1:** Create a template row by choosing the option from the Insert Row menu.

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

**STEP 2:** Enter the title and the desired formula in the editor. When you click Create, the row gets created across all levels of the hierarchy.

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

**STEP 3:**  Set the row position to ‘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/mhGn0sdqmXbigQKXOdJN" alt=""><figcaption></figcaption></figure>

**STEP 4:** Select the **Apply the same style to all rows** checkbox if you want to replicate the same formatting to all the template rows. For example, let's apply a background color to the row.

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

**STEP 5:** To include the row value in subtotals and totals, check the 'Include in total' check box.

<figure><img src="/files/5IG7CfFJ7cmZRPOLCwS6" alt=""><figcaption></figcaption></figure>

**STEP 6:** 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 %}

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

**STEP 7:** 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 for 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)

**STEP 8:** 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/8HBDwZd0QrGxh89oakXq" alt=""><figcaption></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/template-rows/template-rows-1.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.
