# Aggregated queries

Some aggregation plugins are available to count some data. You can use them in simple queries.

If you look at the indexer playground docs and schema on the right panel, you can see some aggregate fields. They allow us to make some mathematical calculations for some specific dataNFTs. Let's keep the example to query some NFT filtered by a specific owner and calculate the total amount in CAPS for each listed NFT.

```graphql
query {
  nftEntities(
    filter: {
      owner: { equalTo: "5CDGXH8Q9DzD3TnATTG6qm6f4yR1kbECBGUmh2XbEBQ8Jfa5" }
    }
  ) {
    totalCount
    aggregates {
      sum {
        priceRounded
      }
    }
    nodes {
      nftId
      owner
      creator
      collectionId
      offchainData
      priceRounded
    }
  }
}
```

The expected outcome will be :

```graphql
...
aggregates: {
        sum: {
          priceRounded: 39900
        }
      },
...
```

<figure><img src="/files/0QNTHUcWSXGGoRe6MYnb" alt=""><figcaption></figcaption></figure>


---

# 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.ternoa.network/build-1/javascript/indexer/global-requests/aggregated-queries.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.
