# Column Totals

## Properties Menu - Column Total <a href="#properties-menu---column-total" id="properties-menu---column-total"></a>

In Vitara charts, column totals feature is implemented in the Grid chart. By default, the column total is not shown. We have to enable the Column Totals in the ‘SubTotals’ property in the property editor.

<figure><img src="https://106821559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuIDde50GEkigLbPmGgLx%2Fuploads%2FjOTAgodKNa56pxSkWmqP%2Fimage.png?alt=media&#x26;token=90f17a97-a13f-451a-8cfc-885140a87b67" alt=""><figcaption></figcaption></figure>

The only default aggregation for Column Totals is “Sum” of the metrics in the chart.

Below is the screenshot where the column totals are in enabled state in the property editor.

<figure><img src="https://106821559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuIDde50GEkigLbPmGgLx%2Fuploads%2F5sqj6QKiRyEOFFNmP6s3%2Fimage.png?alt=media&#x26;token=ce4da899-73c6-4e38-a173-6d2ed1ebb478" alt=""><figcaption></figcaption></figure>

Below is the screenshot where the Column totals is enabled and ‘Total’ column is displaying in the chart calculationg the metrics in the chart.

<figure><img src="https://106821559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuIDde50GEkigLbPmGgLx%2Fuploads%2Fndv3wKIjmCYm3mamhefl%2Fimage.png?alt=media&#x26;token=3e86ea3c-0069-4f53-8b48-c87f7989c9c1" alt=""><figcaption></figcaption></figure>

## Column totals when Grouping is enabled <a href="#column-totals-when-grouping-is-enabled" id="column-totals-when-grouping-is-enabled"></a>

Group any attirbute in the chart, and enable the column totals in the property editor. The totals column can be added where the totals are calculated acorss the metrics.

<figure><img src="https://106821559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuIDde50GEkigLbPmGgLx%2Fuploads%2FKjPV8mjzE45b8DnYJrUE%2Fimage.png?alt=media&#x26;token=72e1527b-8d7d-4209-8cb1-0e1877d9c4d6" alt=""><figcaption></figcaption></figure>

Below is the screenshot where the grouping is applied on Category attribute and ‘Total’ column is calculating across the metrics ‘Cost’ and ‘Revenue’.

<figure><img src="https://106821559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuIDde50GEkigLbPmGgLx%2Fuploads%2FmlXdjFBkHFmUtAQa6skw%2Fimage.png?alt=media&#x26;token=a61d46a3-4194-4325-9066-1a466f5ce9fa" alt=""><figcaption></figcaption></figure>

### **Column Totals with Pivot**

#### **To get totals across the metrics in the chart.**

Pivot any attribute in the chart and the other attributes automatically gets grouped in the char. Enable the Column Totals in the Sub totals property. Now you can see the ‘Total’ column calculated across the metrics.

Below is the screenshot where Category attribute is pivoted and Total is calculated across the Cost and Profit metrics.

<figure><img src="https://106821559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuIDde50GEkigLbPmGgLx%2Fuploads%2FRUfkJdtcEmiiSOGwraeP%2Fimage.png?alt=media&#x26;token=c93f6798-f544-495b-8e81-e8885d2a26ca" alt=""><figcaption></figcaption></figure>

#### **To get totals on a single metric next to the attribute.**

Assume two attributes and two metrics are added to the Vitara Grid chart. Apply ‘Move to Rows’ on any metric in the chart, then Pivot the ‘Metrics’ column along with a attribute and the other attribute will be automatically grouped. Make sure the ‘Metrics’ column should be in the first position of the Pivot zone.

Below is the screenshot where the Category, Quarter are the two attributes and Cost, Revenue are the two metrics added to the chart. The ‘Mover to rows’ is applied on a metric in the chart and the ‘Metrics’ column is pivoted along with the ‘Category’ attribute.

<figure><img src="https://106821559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuIDde50GEkigLbPmGgLx%2Fuploads%2FkCmSMDhFCt12irN4DXIR%2Fimage.png?alt=media&#x26;token=1912ae4a-a67a-4e10-8546-0045b4eb5dbb" alt=""><figcaption></figcaption></figure>

Enable the Column Totals in the Sub totals property. Now you can get the Totals on a single attribute next to the attribute in the chart.

<figure><img src="https://106821559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuIDde50GEkigLbPmGgLx%2Fuploads%2F5Q1hDyM3sJba6j80R2XY%2Fimage.png?alt=media&#x26;token=55605ad8-f959-49dc-a487-481cb94dd326" alt=""><figcaption></figcaption></figure>

Below is the screenshot shown where Total column is shown when ‘Metrics’ column and Category attribute are pivoted and Quarter attribute is grouped. Now you can see the totals on the ‘Cost’ metric next to the Quarter attribute.

<figure><img src="https://106821559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuIDde50GEkigLbPmGgLx%2Fuploads%2FUHOh890lXWclNn0hOjfY%2Fimage.png?alt=media&#x26;token=382a4eff-3815-416e-9090-a17bdf3fad03" alt=""><figcaption></figcaption></figure>

**Enhancement** :Column Totals option will only be used to display total columns in non-pivoted charts. When using a pivot, this option will be hidden. Two new options have been added to the Subtotal tab: **Pivot Row Total** and **Pivot Group Total**. [Click here](https://tsdocs.vitaracharts.com/grid-chart-guide/subtotals#introducing-pivot-row-total-and-pivot-group-total-for-advanced-subtotaling) for detailed information.


---

# 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://tsdocs.vitaracharts.com/grid-chart-guide/column-totals.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.
