*Free**Pro**Enterprise*

The Calculator allows you to create relationships between rows and quantify new totals using event counts, user counts, or numerical values. The Calculator can be accessed by clicking the icon located in the menu bar beneath the query builder.

Using the calculator, you may add, subtract, multiply, or divide any two query rows. Only two rows may be used in a single calculation. The Calculator modal displays a list of your query rows on the left and calculator field, including a list of mathematical operations, on the right. The list of query rows will display the row name, which you may edit or rename within the query builder.

## Calculate Using Rows

To create a calculation using two rows, simply select the row name you’d like to use, then click to drag and drop the row name into the first (top) or second (bottom) drop zone. You may switch drop zones by clicking the up and down arrows to the left of the calculator field. You may also remove a row from the calculator by clicking the red “X” icon before the row name.

The calculator supports the four basic mathematical operations- addition, subtraction, multiplication, and division- and can also automatically calculate a percentage. To change the operation for your calculation, simply select the relevant icon.

Once you’ve completed each field and selected an operation, click “Calculate” to create a new query row containing your calculation. You may click on a calculation query row to edit the calculation at any time. Calculations are visualized in the chart area alongside the underlying queries.

## Calculate Using Numbers

You may also create a calculation using numerical values. To add a number to your calculation, simply click on the first (top) or second (bottom) drop zone and enter the value. Numerical values can be used independently or in combination with a query row.

## Complex Calculations

Only two rows may be used in a single calculation. If you’d like to create a calculation with more than two rows, you’ll need to use a calculation query row as a component of another calculation. For example, to calculate the sum of A+B+C, you may calculate A+B and then use this new row to calculate (A+B)+C. Changes in underlying query rows are calculated before calculation query rows, so your calculation will update automatically if its underlying data changes.

You may hide the component queries by hovering over the row you’d like to hide, then selecting “Deactivate Row.” This will not delete the row, but the hidden row will not appear in your results. Deactivated rows are grayed out in the query builder.

## How It's Done

Calculations are performed with the results of the two composing query rows. For example, imagine you had the following rows:

- Users who performed add to cart
- Users who performed remove from cart

If we perform a calculation to subtract the second row from the first row, Indicative will first find the results of the two composing rows and then perform the subtraction between them. Please note, this means that the subtraction is not resulting in a list of users who added to cart and then removed from cart. To do this analysis, see the article on Did [not] Perform Clauses.