# Calculate

The *Calculate* action node allows you to perform mathematical operations on flow variables.

You can use two types of mathematical operations:

* **Comparison:** Variables are compared against each other as per the expression -  if it matches, a "Yes" result is returned, if it doesn't match, a "No" result is returned.
* **Calculation:** The result of the expression is calculated and stored under a session variable \[\[actionName:result]]*.* In other words, if you want to refer to the result of this calculation in another node, \[\[actionName:result]] is the variable name you should use. If successfully calculated, a "Yes" result is returned, else a "No" result is returned.

<figure><img src="/files/hj2XL89tQFKEtkncMYhR" alt="" width="563"><figcaption><p>Setup of a Calculate node</p></figcaption></figure>

![Example flow containing Calculate node](/files/-MeiNCx8Y9pTBqlCRZUk)

### Examples

The table below describes examples of mathematical expressions you can define in Chat Flow. You can create expressions as simple or complex as required.&#x20;

| Description | Example                                                                                                               |                            |
| ----------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| + - / \*    | Standard math calculations (add, subtract, divide, multiply)                                                          | a+b, a-b, a/b, a\*b        |
| = > < >= <= | Standard comparison operators (equals to, greater than, less than, greater than or equals to, less than or equals to) | a=b, a>b, a\<b, a>=b, a<=b |
| !=          | Not equal to comparison operator                                                                                      | a!=b                       |


---

# 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://guides.clickatell.com/flow/action-nodes/action-nodes-math.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.
