---
schema_version: "1"
id: c1aa9fb56ca8418682834397da26b6bff6a29d28de2d6ac2f9e198c8f1ae9c1b
title: avg
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.5/dw-core-functions-avg.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.5/dw-core-functions-avg
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 6572bb3b15fe05d5d7b3ff4b7516f4c10b64ee930a6ee66baa38ba84120c8b5c
description: MuleSoft Documentation Site
release: "2.5"
latest: false
---
# avg

## [](#avg1)avg(values: Array<Number>): Number

配列に含まれる数値の平均を返します。

配列が空か、配列に非数値が含まれる場合はエラーになります。

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

<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
---
{ a: avg([1, 1000]), b: avg([1, 2, 3]) }
```

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

```JSON
{ "a": 500.5, "b": 2.0 }
```