---
url: /technical/dataspreading-subtract.md
description: subtracts the input number from the cell intersection.
---

# /subtract

subtracts the input number from the cell intersection.

If the cell is a consolidation intersection, slices to the populated child cells and proportionately subtracts from the child cell value.

Proportion is based on the following:

```js
childCellValue/sumOfAllChildCellValues * inputNumber
```

### Parameters

```js
/subtract inputNumber
```

`inputNumber` - the number amount to be subtracted from the cell intersection.

### Examples

![/subtract Workview](/dataspreading-workview.png)
Before `/subtract`
![Before /subtract](/dataspreading-subtract-before.png)
After `/subtract`
![After /subtract](/dataspreading-subtract-after.png)

* 2/3 of the `inputNumber` of 300 was subtracted from `Direct Revenue` cell.
* 1/3 of the `inputNumber` of 300 was subtracted from the `Direct Cost of Goods` cell.

### Example Hierarchy Used

![Dataspreading Hierarchy](/dataspreading-hierarchy.png)

::: info

* `/subtract` does not work on string measures.
* `/subtract` does not work if the cell or descendant cells are equal to 0.
* `/subtract` does not correctly subtract the `inputNumber` from the consolidation cell if the consolidation cell includes populated children where the value of the child will be flipped through the use of \[-1] element signage.
  :::
