# Arithmetic operators
URL: https://docs.valsight.ai/arithmetic-operators/
Description: Arithmetic operators combine numeric values in formulas. Use them for simple calculations, KPI logic, and combining driver nodes.
Arithmetic operators **combine numeric values** in formulas. Use them for simple calculations, KPI logic, and combining driver nodes.

When inputs have different dimensionality, arithmetic can also change the output shape.

## Start here if you want to:

* Perform a calculation such as `'Revenue' + 'Other income'`
* Combine driver nodes with `+`, `-`, `*`, or `/`
* Understand how output shape changes when inputs have different dimensionality

## Not here if you want to:

* Compare values or build a condition → see [Comparisons & boolean operators](/comparisons-boolean-operators/)
* Use validated functions with stricter mismatch handling → see [RATIO](/ratio/), [MULTIPLY](/multiply/), [DIVIDE](/divide/), or [UNION](/union/) in the [function catalog](/function-catalog/)

## Mental model

Arithmetic operators work row-wise on matching intersections of level values.

When inputs do not have the same dimensionality, the operator can change the output shape:

* `+` and `-` aggregate both inputs to their **common dimensions** (the **intersection** of the shared dimensions)
* `*` and `/` calculate across the **combined dimension set** (the **union** of both inputs’ dimensions)

As a rule of thumb:

* `+` and `-` keep the **coarser** level in each shared dimension
* `*` and `/` keep the **finer** level in each shared dimension

If your output shape matters, make the intended dimensionality explicit before combining nodes, for example with `ROLLUP`, `ROLLUP_TO`, `EXPAND`, or `DROPLEVEL`.

## Operator reference

| Operator | Details                                 | Use for          | Common patterns              |
| -------- | --------------------------------------- | ---------------- | ---------------------------- |
| `+`      | [ADDITION (+)](/addition/)              | Sum values       | `'Revenue' + 'Other income'` |
| `-`      | [SUBTRACTION (-)](/subtraction/)        | Compute deltas   | `'Revenue' - 'COGS'`         |
| `*`      | [MULTIPLICATION (\*)](/multiplication/) | Multiply values  | `'Price' * 'Volume'`         |
| `/`      | [DIVISION (/)](/division/)              | Calculate ratios | `'Profit' / 'Revenue'`       |

## When to prefer a function

* Use `RATIO('Gross Profit', 'Revenue')` when you want a ratio that keeps only the shared dimensions of both inputs
* Use `ADDEACH('Sales', 1)` when you want to add a constant to each value without relying on arithmetic shape behavior
* Use `MULTIPLY('Price', 'Volume')`, `DIVIDE('Profit', 'Revenue')` when you need stricter validation and clearer mismatch handling
* Use `UNION('Revenue', 'Other income')` when you want to combine result sets while enforcing matching levels and preventing silent overlap

## Pitfalls & troubleshooting

* **Wrong shape after** `+` **or** `-`: check whether the inputs were aggregated to their common dimensions before the calculation
* **Unexpected expansion after** `*` **or** `/`: check whether the result kept the combined dimension set
* **Unexpected level detail**: remember that `+` and `-` keep the coarser shared level, while `*` and `/` keep the finer shared level
* **Need stricter mismatch handling**: use validated functions such as `MULTIPLY`, `DIVIDE` or `UNION`
* **Sign mistakes**: consider modeling cost positions as negative values and using `+` consistently

## Related

* [Formula basics](/formula-basics/): evaluation order, constants, and quoting rules
* [Dimensionality & hierarchies](/dimensionality-hierarchies/): functions for explicit shaping
* [Troubleshooting guide](/troubleshooting-guide/): wrong shape, wrong numbers, and empty output
