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

## [](#sum1)sum(values: 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
```