# '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="https://3920520305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyZbW8vbNs5hz8x57emJJ%2Fuploads%2F2tXmYxP6KcrA3ATLAt4L%2FReporting_sum_function.png?alt=media&#x26;token=32b7a952-70d4-468f-ba14-07a1b091d4e9" alt=""><figcaption><p>Navigating to the Run Editor</p></figcaption></figure>

<figure><img src="https://3920520305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyZbW8vbNs5hz8x57emJJ%2Fuploads%2FyYTHBQpGMFabVdMpy7sB%2FReporting_sum_function_accesing_run_editor.png?alt=media&#x26;token=3719a3b3-d6c8-48aa-b382-57fb0c9c103a" 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="https://3920520305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyZbW8vbNs5hz8x57emJJ%2Fuploads%2FAm8B5SE1zPRJogqAG8cY%2Fimage.png?alt=media&#x26;token=9b1956bd-d673-41e9-872c-0005e9b62748" alt="" width="563"><figcaption><p>Utilizing Expression Editor</p></figcaption></figure>
