# DELTA_ABS
URL: https://docs.valsight.ai/delta-abs/
Description: The DELTA_ABS function calculates the absolute difference between consecutive values within a selected dimension. The result is signed (current - previous).
**Category:** [Compare periods](/compare-periods/)

## Overview

The **DELTA\_ABS** function calculates the **absolute difference between consecutive values** within a selected dimension. The result is signed (`current - previous`), so values can be negative.

Use this function when you need the absolute change between consecutive values along any dimension, not just time.

## Syntax

`DELTA_ABS('Node', ["Dimension", ["FirstValueBehavior"]])`

**Example usage:** `DELTA_ABS('Revenue')`

## Parameters

| Parameter              | Description                                                                 | Type           | Required | Default                             |
| ---------------------- | --------------------------------------------------------------------------- | -------------- | -------- | ----------------------------------- |
| **Node**               | Input node, specified using the node name in single quotes (e.g.`'Profit'`) | Node reference | Yes      | --                                  |
| **Dimension**          | The dimension along which consecutive values are compared                   | Dimension name | No       | `"Time"` at the node's finest level |
| **FirstValueBehavior** | How the first value in each series of consecutive values is handled         | Keyword        | No       | `"SKIP_FIRST"`                      |

**FirstValueBehavior options:**

* `"SKIP_FIRST"`: The first value in each series is removed from the result. This is the default.
* `"FIRST_AS_ZERO"`: The first value in each series is set to zero.
* `"FIRST_VALUE"`: The first value in each series is kept as it is.

## Output shape

| Aspect         | Behavior                                                                                                                                                         |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Dimensionality | Same as input. All dimensions and levels of the input are preserved.                                                                                             |
| Granularity    | The absolute difference is computed on the lowest available level of the chosen Dimension.                                                                       |
| Values         | Each result row is `current - previous` along the chosen Dimension. Results are signed and can be negative.                                                      |
| Row count      | With **SKIP\_FIRST**, the first entry of each series is dropped, so row count is reduced. With **FIRST\_AS\_ZERO** and **FIRST\_VALUE**, row count is preserved. |

## Watch out

* The absolute difference is always calculated on the lowest available level of the specified dimension.
* The function compares **only** entries that actually exist in the input. Missing values are skipped. To calculate the absolute difference with filled missing values, use [YOY\_ABS](/yoy-abs/) for year-over-year, or fill gaps before calling DELTA\_ABS.
* With **SKIP\_FIRST** (default), series that contain only a single entry are dropped from the result entirely. Use `FIRST_AS_ZERO` or `FIRST_VALUE` to keep them.
* If the chosen Dimension's levels are linked from levels in another Dimension within the input, the calculation fails. In that case, calculate the delta on the linking Dimension instead.
* The result will use the same level links as those defined in dimension management. Do not use this function if your node needs level links that differ from the dimension's defaults.

## Examples

### Default: skipping first values

The function subtracts the value of the previous available entry from the current one, based on the order of the chosen dimension `"Time"`. Missing entries are skipped, and the first entry per series is dropped.

**Input node:** `'Input node'`

| Year | Month   | Product | Value |
| ---- | ------- | ------- | ----- |
| 2025 | 2025-11 | A       | -30   |
| 2025 | 2025-11 | B       | 2     |
| 2026 | 2026-04 | A       | 25    |
| 2026 | 2026-05 | B       | -10   |
| 2026 | 2026-05 | C       | 15    |

**Formula:** `DELTA_ABS('Input node')`

**Equivalent to:** `DELTA_ABS('Input node', "Time", "SKIP_FIRST")`

| Year | Month   | Product | Calculation | Result |
| ---- | ------- | ------- | ----------- | ------ |
| 2026 | 2026-04 | A       | 25 - (-30)  | 55     |
| 2026 | 2026-05 | B       | -10 - 2     | -12    |

Product A's delta crosses zero: "ABS" means absolute (vs. relative) difference, not magnitude. Product C is missing from the output because it has only one entry, so SKIP\_FIRST drops it.

### First values as zero

Using the same input node as above. With FIRST\_AS\_ZERO, the first entry per series gets a result of 0 instead of being omitted, and single-entry series are preserved.

**Formula:** `DELTA_ABS('Input node', "Time", "FIRST_AS_ZERO")`

| Year | Month   | Product | DELTA\_ABS Result |
| ---- | ------- | ------- | ----------------- |
| 2025 | 2025-11 | A       | 0                 |
| 2025 | 2025-11 | B       | 0                 |
| 2026 | 2026-04 | A       | 55                |
| 2026 | 2026-05 | B       | -12               |
| 2026 | 2026-05 | C       | 0                 |

Product C now appears in the result with value 0 because its single entry is treated as a "first value".

### Keeping first values

Using the same input node as above. With FIRST\_VALUE, the first entry per series keeps its original value instead of being omitted or zeroed.

**Formula:** `DELTA_ABS('Input node', "Time", "FIRST_VALUE")`

| Year | Month   | Product | DELTA\_ABS Result |
| ---- | ------- | ------- | ----------------- |
| 2025 | 2025-11 | A       | -30               |
| 2025 | 2025-11 | B       | 2                 |
| 2026 | 2026-04 | A       | 55                |
| 2026 | 2026-05 | B       | -12               |
| 2026 | 2026-05 | C       | 15                |

### Calculating deltas along a non-Time dimension

DELTA\_ABS works on any dimension, not just Time. The example below uses a node that has only a Product level. Deltas are calculated along the Product order.

**Input node:** `'Sales'`

| Product | Value |
| ------- | ----- |
| A       | 10    |
| B       | 30    |
| C       | 15    |

**Formula:** `DELTA_ABS('Sales', "Product")`

| Product | Calculation | Result |
| ------- | ----------- | ------ |
| B       | 30 - 10     | 20     |
| C       | 15 - 30     | -15    |

The first product (A) is dropped under the default SKIP\_FIRST. Each subsequent value is subtracted from the previous one along the Product dimension's order.

## Related

| Function                  | When to use instead                                                                |
| ------------------------- | ---------------------------------------------------------------------------------- |
| [DELTA\_REL](/delta-rel/) | When you need the relative change (percentage) instead of the absolute difference. |
| [YOY\_ABS](/yoy-abs/)     | When you need year-over-year absolute change with filled missing values.           |
| [QOQ\_ABS](/qoq-abs/)     | When you need absolute change specifically quarter-over-quarter.                   |
