ITableSubtotalColumnDefinition
Home > @gooddata/sdk-ui > ITableSubtotalColumnDefinition
ITableSubtotalColumnDefinition type
This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
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:**
| | | Brand > Product | |
| | |---------------------|----------------|
| | | GoodData | |
| | |---------------------|----------------|
| | | Panther | Bear | Sum A |
|---------|--------|---------------------|----------------|
| Country | City | Sales | Sales | Sales |
|---------|--------|----------|----------|----------------|
| USA | NYC | 100 | 150 | 250 |
| USA | LA | 200 | 250 | 450 |
Signature:
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, IResultTotalHeader, IAttributeDescriptor, IMeasureDescriptor