# YOY_ABS
URL: https://docs.valsight.ai/yoy-abs/
Description: The YOY_ABS function returns the absolute growth for each year compared to the previous year (year-over-year). The result is the difference current_year - previous_year in the same unit as the input.
**Category:** [Compare periods](/compare-periods/)

## Overview

The **YOY\_ABS** function **returns the absolute growth for each year compared to the previous year** (year-over-year). The result is the difference `current_year - previous_year` in the same unit as the input.

Use this function when you need the absolute difference between consecutive years.

## Syntax

`YOY_ABS('Node' [, "MissingValueBehaviour"])`

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

## Parameters

| Parameter                 | Description                                                                  | Type           | Required | Default            |
| ------------------------- | ---------------------------------------------------------------------------- | -------------- | -------- | ------------------ |
| **Node**                  | Input node, specified using the node name in single quotes (e.g.`'Revenue'`) | Node reference | Yes      | --                 |
| **MissingValueBehaviour** | How missing values in the time series are treated                            | Keyword        | No       | `"IGNORE_MISSING"` |

**MissingValueBehaviour options:**

* `"IGNORE_MISSING"`: Missing rows are skipped. A result row is only produced where both the current year and the previous year have values. This is the default.
* `"MISSING_AS_ZERO"`: Missing rows are treated as 0.

## Output shape

| Aspect         | Behavior                                                                                                                                                                                |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Dimensionality | Same as input.                                                                                                                                                                          |
| Time range     | With IGNORE\_MISSING, the first year is dropped and years adjacent to gaps are also removed.  With MISSING\_AS\_ZERO, every year where either current or previous has data is included. |
| Values         | Each value is `current_year - previous_year`. The result keeps the same unit as the input.                                                                                              |
| Row count      | Reduced with IGNORE\_MISSING.  With MISSING\_AS\_ZERO, can include years beyond the input data range (within the project horizon).                                                      |

## Watch out

* The input must have a **Year** level. If the input does not contain a Year level, the function fails.
* With **MISSING\_AS\_ZERO**, results appear at years where the input has no data. A missing current year treated as 0 produces a negative result equal to the previous year's value. A missing previous year treated as 0 produces a positive result equal to the current year's value.
* With **MISSING\_AS\_ZERO**, years beyond the input data range (but within the project horizon) may appear in the result.

## Examples

### Default: ignoring missing values

This example shows YOY\_ABS with the default behavior.

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

| Year | Value |
| ---- | ----- |
| 2025 | 200   |
| 2026 | 300   |
| 2027 | 450   |
| 2028 | 500   |
| 2030 | 100   |

**Formula:** `YOY_ABS('Profit')`

**Equivalent to:** `YOY_ABS('Profit', "IGNORE_MISSING")`

| Year | Calculation | Result |
| ---- | ----------- | ------ |
| 2026 | 300 - 200   | 100    |
| 2027 | 450 - 300   | 150    |
| 2028 | 500 - 450   | 50     |

The first year (2025) has no previous year to compare against. The gap at 2029 causes both 2029 and 2030 to be excluded.

### Treating missing values as zero

With MISSING\_AS\_ZERO, gaps are filled with 0, producing results for every year including those without input data.

**Formula:** `YOY_ABS('Profit', "MISSING_AS_ZERO")`

| Year | Calculation | Result |
| ---- | ----------- | ------ |
| 2025 | 200 - 0     | 200    |
| 2026 | 300 - 200   | 100    |
| 2027 | 450 - 300   | 150    |
| 2028 | 500 - 450   | 50     |
| 2029 | 0 - 500     | -500   |
| 2030 | 100 - 0     | 100    |
| 2031 | 0 - 100     | -100   |

Year 2025 now has a result because its previous year (2024) is treated as 0. Year 2031 (beyond the input data but within the project horizon) also appears because 2030 has a value.

## Related Functions

| Function                  | When to use instead                                                                                  |
| ------------------------- | ---------------------------------------------------------------------------------------------------- |
| [YOY\_REL](/yoy-rel/)     | When you need the percentage change year-over-year instead of the absolute difference.               |
| [DELTA\_ABS](/delta-abs/) | When you need the absolute change along any dimension, not just time (e.g. compare across products). |
| [CAGR](/cagr/)            | When you need compound growth over multiple periods, not just a single-period comparison.            |
