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

## [](#avg1)avg(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 }
```