---
schema_version: "1"
id: 53bdd91f153a699a926716d08d60a14670b2b662863ceb76ee995da712124afa
title: sum
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.6/dw-core-functions-sum.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.6/dw-core-functions-sum
source_site: docs.mulesoft.com
content_type: documentation
content_hash: cb3ad3ccb63936635d1f5d9f0a69629d6df6915cd39ea95f1be5882034a13226
description: MuleSoft Documentation Site
release: "2.6"
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
```