# PY
URL: https://docs.valsight.ai/py/
Description: Shifts the input node one year into the future while retaining all other dimensions. Use this when you need last year's values alongside current data for year-over-year comparisons.
**Category:** [Compare periods](/compare-periods/)

## Overview

The **PY** function **shifts the input node one year into the future** while retaining all other dimensions.

Use this function when you need last year's values alongside current data for year-over-year comparisons.

## Syntax

`PY('Node')`

## Parameters

| Parameter | Description                                                                                  | Type           | Required |
| --------- | -------------------------------------------------------------------------------------------- | -------------- | -------- |
| **Node**  | Input node that is shifted, specified using the node name in single quotes (e.g. `'Profit'`) | Node reference | Yes      |

## Examples

### Shifting values by one year

Each value appears one year later in the result.

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

| Year | Value |
| ---- | ----- |
| 2025 | 35    |
| 2026 | 42    |
| 2027 | 47    |

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

| Year | PY Result |
| ---- | --------- |
| 2026 | 35        |
| 2027 | 42        |
| 2028 | 47        |

### Shifting values by two years (nested PY)

Nesting PY calls shifts values further into the future. Here, each value moves two years forward.
Try [SHIFT](/shift/) as an alternative with a custom offset.

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

| Year | Value |
| ---- | ----- |
| 2025 | 38    |
| 2026 | 45    |
| 2027 | 52    |

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

| Year | PY Result |
| ---- | --------- |
| 2027 | 38        |
| 2028 | 45        |
| 2029 | 52        |

## Related Functions

| Function              | When to use instead                                                                      |
| --------------------- | ---------------------------------------------------------------------------------------- |
| [PQ](/pq/)            | When you need the previous quarter instead of the previous year.                         |
| [SHIFT](/shift/)      | When you need a custom offset or want to shift along a specific time level.              |
| [YOY\_ABS](/yoy-abs/) | When you need the absolute difference to the previous year, not just the shifted values. |
