# 'Sum' function

The Sum function for a label or table cell allows you to collect data from different elements. This function allows you to perform a simple count of the number of items without having to use scripts.

To do this, go to the properties of a field in the Data section and select Summary. In the running field, you can choose to total only the group, the whole report or each page.

<figure><img src="http://aquawiki.andagon.com/pictures/drex_sum_function_1_custom.png" alt="" width="375"><figcaption></figcaption></figure>

&#x20;In the Run Editor (white box next to the summary) you can then select the function, i.e. whether you want the summary to be summed, counted (number) or other groupings.

<figure><img src="/files/ceqIQmeewnjV8YS1GLwA" alt=""><figcaption><p>Navigating to the Run Editor</p></figcaption></figure>

<figure><img src="/files/j2anSviUxT8Gulwl2VOe" alt="" width="514"><figcaption><p>Accessing the Expression Editor</p></figcaption></figure>

Using respective formula fields (for example, “If output 0/1” (see formula below)), you can calculate characteristic values for elements.&#x20;

{% code overflow="wrap" %}

```
Iif([LastExecutionStatusInvariant]=='Passed', 1, 0) 
// all test cases with the status “Passed”
```

{% endcode %}

<figure><img src="/files/9M1MSnF94MS6UCa587m5" alt="" width="563"><figcaption><p>Utilizing Expression Editor</p></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.aqua-cloud.io/documentation/reporting/sum-function.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.
