---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, PMD Scripting, Scripts]
nav: wcp_docs
parent_url: /wcp_docs/
title: getSubtotal (grid, columnId)
layout: subsection
---

## <a id="section_m3p_myb_5db"></a>Description

Returns the total of the values in a given numeric column of a grid. The `getSubtotal` function treats an empty value as zero. An error occurs if the column isn't numeric. The amount of available memory limits the maximum number of rows to add. Several thousand rows without server-side paging and usage of pagingInfo in the grid tag can result in performance issues.

## <a id="section_cyq_j1m_zsb"></a>Return Type

`BigDecimal`

## <a id="section_dz5_pwg_5db"></a>Namespace Function Syntax

```
grid:getSubtotal(grid, columnId)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>grid</td><td>The <code>id</code> that references the grid.</td></tr><tr><td>columnId</td><td>A string containing the ID of the column containing the values to add.</td></tr></tbody></table><br/>

<b>Example</b>

`grid:getSubtotal(myGrid, 'columnId1')`

Returns `101.95`

