> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# ITableSubtotalColumnDefinition

- Package: [@gooddata/sdk-ui](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/index.md)
- Kind: type-alias
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui/src/base/results/tableData/interfaces/columns.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Defines columns that show subtotal values.

\*\*What it does:\*\* Shows subtotals - these are columns that show the aggregation of values for a specific attribute pivoting subgroup.

\*\*When it's created:\*\* - Only when you have at least 2 attributes in the columns bucket (pivoting). - Only when you set total for pivoting subgroup (not the leftmost column attribute - then it's grand total). - In the example, total is set for Product x Sales.

\*\*Real example:\*\*

```tsx
|         |        | Brand > Product     |                |
|         |        |---------------------|----------------|
|         |        | GoodData            |                |
|         |        |---------------------|----------------|
|         |        | Panther  | Bear     | Sum A          |
|---------|--------|---------------------|----------------|
| Country | City   | Sales    | Sales    | Sales          |
|---------|--------|----------|----------|----------------|
| USA     | NYC    | 100      | 150      | 250            |
| USA     | LA     | 200      | 250      | 450            |
```

**Signature:**

```typescript
export type ITableSubtotalColumnDefinition = {
    type: "subtotal";
    columnIndex: number;
    columnHeaderIndex: number;
    columnScope: ITableDataHeaderScope[];
} & (/**
   * Handles case, when pivoting and measures are in rows.
   */ {
    isEmpty: false;
    isTransposed: true;
    totalHeader: IResultTotalHeader;
    attributeDescriptor: IAttributeDescriptor;
}
/**
 * Handles standard pivoting case without transposition.
 */
 | {
    isEmpty: false;
    isTransposed: false;
    totalHeader: IResultTotalHeader;
    measureDescriptor: IMeasureDescriptor;
});
```
**References:** [ITableDataHeaderScope](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/sdk-ui.itabledataheaderscope/index.md), [IResultTotalHeader](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iresulttotalheader/index.md), [IAttributeDescriptor](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iattributedescriptor/index.md), [IMeasureDescriptor](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.imeasuredescriptor/index.md)
