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

# newTotal()

- Package: [@gooddata/sdk-model](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/index.md)
- Kind: function
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-model/src/execution/base/totals.ts
- Guides: [Add totals to a table](https://www.gooddata.ai/docs/gooddata-ui/latest/data-layer/execution/table-totals/index.md)

Creates a new total.

**Signature:**

```typescript
export declare function newTotal(type: TotalType, measureOrId: IMeasure | Identifier, attributeOrId: IAttribute | Identifier, alias?: string): ITotal;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| type | [TotalType](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.totaltype/index.md) | type of total, one of the enumerated types |
| measureOrId | [IMeasure](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.imeasure/index.md) \| [Identifier](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.identifier/index.md) | measure instance OR measure local identifier |
| attributeOrId | [IAttribute](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iattribute/index.md) \| [Identifier](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.identifier/index.md) | attribute instance OR attribute local identifier |
| alias | string | _(Optional)_ provide custom name (alias) for the total; this will be included in the computed results |

**Returns:**

[ITotal](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.itotal/index.md)

new total
