> For the complete documentation index, see [llms.txt](https://docs.nexthink.com/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexthink.com/platform/understanding-key-data-platform-concepts/nexthink-query-language-nql/nql-functions/nql-sumif.md).

# NQL sumif()

The `sumif()` command summarizes values from the rows that match specified criteria. It accepts extra arguments, the conditions that determine which rows to include.

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

```
devices during past 24h
| include web.page_views during past 24h
| where application.name == "Confluence"
| compute total_cnt = page_view.number_of_page_views.sumif(page_view.experience_level == frustrating)
| sort total_cnt desc
| limit 10
```

{% endcode %}

<table data-full-width="true"><thead><tr><th width="225">Name</th><th width="184">Entity</th><th width="290">Hardware → Device model</th><th width="271">Hardware → Device type</th><th width="404">Operating system -> Name</th><th>Total cnt</th></tr></thead><tbody><tr><td>NXDOCS-1704355664</td><td>Switzerland</td><td>MacBookPro18,3</td><td>laptop</td><td>macOS Sonoma 14.2.1 (ARM 64 bits)</td><td>7</td></tr><tr><td>NXDOCS-1704355669</td><td>Spain</td><td>ThinkPad P1 Gen 4i</td><td>laptop</td><td>Windows 11 Enterprise 22H2 (64 bits)</td><td>6</td></tr><tr><td>NXDOCS-1704355676</td><td>India</td><td>HP ZBook Power G7 Mobile Workstation</td><td>laptop</td><td>Windows 11 Enterprise 22H2 (64 bits)</td><td>6</td></tr><tr><td>NXDOCS-1704355687</td><td>Spain</td><td>ThinkPad T14s Gen 3</td><td>laptop</td><td>Windows 11 Pro 22H2 (64 bits)</td><td>5</td></tr><tr><td>NXDOCS-1704355691</td><td>India</td><td>MacBookPro16,1</td><td>laptop</td><td>macOS Ventura 13.6.3 (64 bits)</td><td>5</td></tr><tr><td>NXDOCS-1704355695</td><td>United States</td><td>MacBookPro18,3</td><td>laptop</td><td>macOS Sonoma 14.2.1 (ARM 64 bits)</td><td>5</td></tr><tr><td>NXDOCS-1704355714</td><td>United Kingdom</td><td>MacBookPro18,2</td><td>laptop</td><td>macOS Sonoma 14.2.1 (ARM 64 bits)</td><td>4</td></tr><tr><td>NXDOCS-1704355719</td><td>Switzerland</td><td>MacBookPro18,1</td><td>laptop</td><td>macOS Ventura 13.6.3 (ARM 64 bits)</td><td>4</td></tr><tr><td>NXDOCS-1704355725</td><td>India</td><td>ThinkPad T480</td><td>laptop</td><td>Windows 10 Pro 22H2 (64 bits)</td><td>4</td></tr><tr><td>NXDOCS-1704355730</td><td>United States</td><td>MacBookPro18,1</td><td>laptop</td><td>macOS Sonoma 14.0.0 (ARM 64 bits)</td><td>3</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nexthink.com/platform/understanding-key-data-platform-concepts/nexthink-query-language-nql/nql-functions/nql-sumif.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
