# ABS

The ABS function returns the absolute value of a number (i.e) a number without its sign.

### Syntax

ABS(value) - > number

### Arguments

<table><thead><tr><th width="156">Arguments</th><th width="183">Datatype</th><th>Description</th></tr></thead><tbody><tr><td>value</td><td>Number/Node reference</td><td>The node or the number for which you want the absolute of.</td></tr></tbody></table>

### Example

In the below table, data of demand and inventory are given. Consider a scenario where you want to calculate the absolute difference between demand and inventory.

<table><thead><tr><th width="134">Parameter</th><th width="93" align="center">Week 1</th><th width="112" align="center">Week 2</th><th width="104" align="center">Week 3</th><th width="91" align="center">Week 4</th><th align="center">Week 5</th></tr></thead><tbody><tr><td><mark style="color:green;">Demand</mark></td><td align="center">110</td><td align="center">95</td><td align="center">75</td><td align="center">78</td><td align="center">0</td></tr><tr><td><mark style="color:orange;">Inventory</mark></td><td align="center">85</td><td align="center">70</td><td align="center">100</td><td align="center">80</td><td align="center">25</td></tr></tbody></table>

To achieve this, the following formula should be written in the \[Absolute Difference] node:

<mark style="color:blue;">**`ABS`**</mark>**`(`**<mark style="color:green;">**`[Demand]`**</mark>**`-`**<mark style="color:orange;">**`[Inventory]`**</mark>**`)`**

### Result

<table data-header-hidden><thead><tr><th width="128"></th><th align="center"></th><th align="center"></th><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td>Absolute Difference</td><td align="center">25</td><td align="center">25</td><td align="center">25</td><td align="center">2</td><td align="center">25</td></tr></tbody></table>

#### Note

If ABS is not used the difference between values will be as follows:

<table data-header-hidden><thead><tr><th width="128"></th><th align="center"></th><th align="center"></th><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td>Absolute Difference</td><td align="center">25</td><td align="center">25</td><td align="center">-25</td><td align="center">-2</td><td align="center">-25</td></tr></tbody></table>
