# DELTA_REL
URL: https://docs.valsight.ai/delta-rel/
Description: In contrast to YOY_REL and related relative functions, the growth will be calculated by using the absolute former value as relative base: (currentValue - formerValue) / absolute(formerValue).
**Category:** [Compare periods](/compare-periods/)

## Overview

The **DELTA\_REL** function **calculates the relative difference between consecutive values** within the selected dimension.

Use this function when you need the relative (percentage) change between consecutive values along any dimension, not just time.

## Syntax

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

## 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 per unique level combination is handled.                 | Keyword        | No       | `"SKIP_FIRST"`                      |

**FirstValueBehavior options:**

* `"SKIP_FIRST"`: The first level combination per group will not be present in the result. This is the default.
* `"FIRST_AS_ZERO"`: The value of the first level combination will be set to zero.

## Watch out

* The growth will always be calculated on the lowest available level of the specified dimension.
* If the "former value" is zero, the calculation cannot be performed as a division by zero is not possible. The level combination will therefore not be in the result.
* The function compares **only** entries that actually exist in the input. Missing values are skipped. To calculate the growth with filled missing values, use [YOY\_REL](/yoy-rel/).
* The function ensures that the links from the levels of the specified dimension match those in the dimension management. Do not use this function if you want the node to have different level links as the dimensions.

## Examples

### Default: skipping first values

In contrast to [YOY\_REL](/yoy-rel/) and related relative functions, the growth will be calculated by using the absolute former value as relative base: (currentValue - formerValue) / absolute(formerValue).
This means for example:
The relative growth from -2 to -10 is -400% as (-10 - (-2)) / abs(-2) = (-8 / 2) = -4.

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

| Year | Month   | Product | Value |
| ---- | ------- | ------- | ----- |
| 2025 | 2025-11 | A       | 1     |
| 2025 | 2025-11 | B       | 2     |
| 2026 | 2026-04 | A       | 20    |
| 2026 | 2026-05 | B       | -10   |

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

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

| Year | Month   | Product | Calculation        | Result |
| ---- | ------- | ------- | ------------------ | ------ |
| 2026 | 2026-04 | A       | (20 - 1) / ABS(1)  | 19     |
| 2026 | 2026-05 | B       | (-10 - 2) / ABS(2) | -6     |

### First values as zero

With FIRST\_AS\_ZERO, the first entry per group gets a result of 0 instead of being omitted.

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

| Year | Month   | Product | DELTA\_REL Result |
| ---- | ------- | ------- | ----------------- |
| 2025 | 2025-11 | A       | 0                 |
| 2025 | 2025-11 | B       | 0                 |
| 2026 | 2026-04 | A       | 19                |
| 2026 | 2026-05 | B       | -6                |

## Related

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