---
schema_version: "1"
id: 2ecd46f7076e14fcfbbcc45f0b3cbd71f63364bbedcba8060980c16b1882a2dd
title: sum
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dw-core-functions-sum.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dw-core-functions-sum
source_site: docs.mulesoft.com
content_type: documentation
content_hash: ec652cb9734600a4ee9ae2c055b06a18d7703efa6ae15ee13735808343785cbd
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# sum

## [](#sum1)sum(Array<Number>): Number

配列内の数値の合計を返します。

配列が空の場合は ​`0`​ を返し、配列内に数値以外の値がある場合はエラーになります。

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>values</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">数値の入力配列。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、入力配列内の値の合計を返します。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
output application/json
---
sum([1, 2, 3])
```

#### [](#出力)出力

```JSON
6
```