NQL as()

The as() allows you to display the output from NQL queries in a formatted manner by assigning specific formatting information to the metrics. The Nexthink interface displays the data with the unit specified.​ The as() is supported in the list and the sort clauses.

Example:

devices
| summarize total_cost = count() * 2000
| list total_cost.as(format = currency, code  = USD)

Use the following formatting options:

FormatterUnitExample query

energy

Wh

kWh

MWh

GWh

device_performance.events during past 1d
| where device.operating_system.platform = macos
| where hardware.type == laptop
| summarize estimated_energy = ((8 * 0.070) * device.count())
| list estimated_energy.as( format = energy )

weight

g

kg

t

kt

device_performance.events during past 1d
| where device.operating_system.platform = macos
| where hardware.type == laptop
| summarize estimated_energy = ((8 * 0.070) * device.count())
| list estimated_energy.as( format = energy )

currency

Specify the currency using the additional code parameter.

CAD: CA$

CHF: CHF

GBP: £ EUR: €

USD: $

devices
| summarize total_cost = count() * 2000
| list total_cost.as(format = currency, code  = USD)
devices
| summarize total_cost = count() * 2000
| list total_cost.as(format = currency, code  = EUR)

percent

%

devices
| with execution.crashes
| summarize impacted_devices = countif(operating_system.name == "Windows 10 Pro 22H2 (66 bits)")*100/count()
| list impacted_devices.as(format = percent)

bitrate

bps

Kbps

Mbps

Gbps

connectivity.events during past 30d
| where primary_physical_adapter.type == wifi
| where wifi.signal_strength.avg <= -67 or (context.device_platform == "macOD" and wifi.noise_level.avg >= -80)
| summarize average_receive_rate = wifi.receive_rate.avg()
| list average_receive_rate.as(format = bitrate)

Last updated