# NQL as()

`as()` 関数を使用すると、特定の書式情報を指標に割り当てることで、NQL クエリの出力をフォーマットされた形式で表示できます。 Nexthink インターフェースは、指定された単位でデータを表示します。`as()` 関数は [リスト](/platform/ja/understanding-key-data-platform-concepts/nexthink-query-language-nql/nql-keywords/nql-list.md) および [ソート](/platform/ja/understanding-key-data-platform-concepts/nexthink-query-language-nql/nql-keywords/nql-sort.md) 句でサポートされています。

例:

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

```
デバイス
| 集計 total_cost = count() * 2000
| リスト total_cost.as(形式 = 通貨, コード = USD)
```

{% endcode %}

<figure><img src="/files/REphtH3AGvjXTAYMuSor" alt=""><figcaption></figcaption></figure>

次のフォーマットオプションを使用します:

<table data-full-width="true"><thead><tr><th width="113">フォーマッター</th><th width="180">単位</th><th>例のクエリ</th></tr></thead><tbody><tr><td>エネルギー</td><td><p>Wh</p><p>kWh</p><p>MWh</p><p>GWh</p></td><td><pre data-overflow="wrap" data-line-numbers><code>デバイス_パフォーマンス.イベント 過去1日間
| where device.operating_system.platform = macos
| where hardware.type == laptop
| 集計 推定消費エネルギー = ((8 * 0.070) * device.count())
| リスト 推定消費エネルギー.as(形式 = エネルギー)
</code></pre></td></tr><tr><td>重量</td><td><p>g</p><p>kg</p><p>t</p><p>kt</p></td><td><pre data-overflow="wrap" data-line-numbers><code>devices
| where hardware.type = laptop or hardware.type = desktop
| summarize no_of_devices = (count()^1) * 422.5
| list no_of_devices.as( format = weight )
</code></pre></td></tr><tr><td>通貨</td><td><p><code>code</code> パラメーターを使用して通貨を指定します。</p><p><code>CAD</code>: CA$</p><p><code>CHF</code>: CHF</p><p><code>GBP</code>: £<br><code>EUR</code>: €</p><p><code>USD</code>: $</p></td><td><pre data-overflow="wrap" data-line-numbers><code>デバイス
| 集計 total_cost = count() * 2000
| リスト total_cost.as(形式 = 通貨, コード = USD)
</code></pre><pre data-overflow="wrap" data-line-numbers><code>デバイス
| 集計 total_cost = count() * 2000
| リスト total_cost.as(形式 = 通貨, コード = EUR)
</code></pre></td></tr><tr><td>パーセント</td><td>%<br><br>パーセンテージを計算するには、システムが値を100倍して%記号を追加します。 例えば、0.47の値は47%に変換されます。</td><td><pre data-overflow="wrap" data-line-numbers><code>デバイス
| with 実行.クラッシュ
| 集計 影響を受けたデバイス = countif(operating_system.name == "Windows 10 Pro 22H2 (66 bits)")/count()
| リスト 影響を受けたデバイス.as(形式 = パーセント)
</code></pre></td></tr><tr><td>ビットレート</td><td><p>bps</p><p>Kbps</p><p>Mbps</p><p>Gbps</p></td><td><pre data-overflow="wrap" data-line-numbers><code>接続性.イベント 過去30日
| where primary_physical_adapter.type == wifi
| where wifi.signal_strength.avg &#x3C;= -67 or (context.device_platform == "macOS" and wifi.noise_level.avg >= -80)
| 集計 平均受取レート = wifi.receive_rate.avg()
| リスト 平均受取レート.as(形式 = ビットレート)
</code></pre></td></tr></tbody></table>


---

# 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-functions/nql-as.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.
