> For the complete documentation index, see [llms.txt](https://docs.cascade.io/cascade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cascade.io/cascade/cascade-faqs/best-practices/how-to-add-a-total-row-to-a-table.md).

# How to add a total row to a table

We went ahead and created a quick pivot table with the sum of ordered products and the sum of the transactional sale price.

<figure><img src="/files/rBWzN1QJdLMBDFEFlRmk" alt=""><figcaption><p>Pivot table in Cascade</p></figcaption></figure>

What we might recommend is using a another [Pivot](/cascade/tools/transform/pivot.md) tool to sum the entire Quantity Ordered and Price Each fields.

<figure><img src="/files/9hmufkqMlgYEwGgPYvLJ" alt=""><figcaption><p>Configuration of <a href="/pages/-MYR3r3o9e06fuhOlQaL">Pivot</a> tool with total value</p></figcaption></figure>

Afterwards, we’d use an [Append](/cascade/tools/combine/append.md) tool to stack the new total record from the second [Pivot](/cascade/tools/transform/pivot.md) tool beneath the first table.

<figure><img src="/files/J7Z23FgP8WpPUUar5ipO" alt=""><figcaption><p>Connect the two <a href="/pages/-MYR3r3o9e06fuhOlQaL">Pivot</a> tools to an <a href="/pages/-MYR5DXVgXDD3zLfPJm2">Append</a> tool</p></figcaption></figure>

<figure><img src="/files/qUuQsz6rIsLHbjujKda8" alt=""><figcaption><p>Configuration window of the <a href="/pages/-MYR5DXVgXDD3zLfPJm2">Append</a> tool</p></figcaption></figure>

Feel free to use an [Edit Columns](/cascade/tools/transform/editcolumns.md) tool and [Select Columns](/cascade/tools/transform/selectcolumns.md) tool to apply the value ‘Total’ at the bottom of the table.

<figure><img src="/files/hP66v4MQd27AvJhnSwf8" alt=""><figcaption><p>Total row appended to the pivot table</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, and the optional `goal` query parameter:

```
GET https://docs.cascade.io/cascade/cascade-faqs/best-practices/how-to-add-a-total-row-to-a-table.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
