# Rule action: Calculate sum

**Used for:** calculating the sum of a field that contains a list of numbers.

**Used in:** "THEN"-statements and "ELSE"-statements.

The "calculate sum" rule is used to calculate the sum of a list of numbers. An example use case is when you have a list of stock numbers for every size of a product. Using the "calculate sum" rule you could easily calculate the total stock amount for that product, which would look like shown below.

<figure><img src="https://helpcenter.channable.com/hc/article_attachments/360007546279/channable_rules_what-does-each-rule-do-rule-calculate-sum-0.png" alt=""><figcaption></figcaption></figure>

The output of this rule would look like this:

&#x20;

<figure><img src="https://helpcenter.channable.com/hc/article_attachments/360007546299/channable_rules_what-does-each-rule-do-rule-calculate-sum-1.png" 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://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-actions-then-in-rules/rule-action-calculate-sum.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.
