# NQLサマライズ

`要約` ステートメントは情報を1つの結果に凝縮します。

### 構文 <a href="#nqlsummarize-syntax" id="nqlsummarize-syntax"></a>

{% code overflow="wrap" lineNumbers="true" %}

```
...
| summarize <新しい指標名> = <指標>.<集計関数>
```

{% endcode %}

### 例 <a href="#nqlsummarize-examples" id="nqlsummarize-examples"></a>

デバイスごとのページビュー数の平均値を計算します。

{% code overflow="wrap" lineNumbers="true" %}

```
デバイス
| web.page_views を 6月1日から6月7日まで指定
| num_navigations = number_of_page_views.sum() を計算
| 要約 average_num_navigation_per_device = num_navigations.avg()
```

{% endcode %}

| average\_num\_navigation\_per\_device |
| ------------------------------------- |
| 115.9                                 |

過去7日間にアクティブなデバイスの数をカウントします。 `count()` 集約関数の場合、ルートテーブルのレコード数をカウントするためには、集約の前にフィールド名を省略できます。

{% code overflow="wrap" lineNumbers="true" %}

```
過去7日間のデバイス
| 要約 number_of_devices = count()
```

{% endcode %}

| number\_of\_devices |
| ------------------- |
| 285                 |

すべてのバイナリの合計サイズを計算します。

{% code overflow="wrap" lineNumbers="true" %}

```
過去7日間のバイナリ
| 要約 total_size = size.sum()
```

{% endcode %}

| total\_size |
| ----------- |
| 611.3 GB    |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nexthink.com/platform/ja/understanding-key-data-platform-concepts/nexthink-query-language-nql/nql-keywords/nql-summarize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
