Skip to main content
Skip table of contents

YTD

Category: Rollforward & time series

Overview

The YTD function returns year-to-date values by calculating a running sum per year over the lowest available time level. The cumulative sum resets at the start of each new year. Missing periods within a year are filled with the last cumulative value; missing periods at the start of a year are not filled.

Use this function when you want cumulative values within each year that reset at the start of a new year.

Syntax

YTD('Node')

Example usage: YTD('Revenue')

Parameters

Parameter

Description

Type

Required

Node

Input node, specified using the node name in single quotes (e.g.'Revenue')

Node reference

Yes

Output Shape

Aspect

Behavior

Dimensionality

Same as input.

Time range

Periods within a year are filled forward from the first available value to the end of the year. Missing periods at the start of a year are not filled. Years with no data at all are not included.

Values

Cumulative sum within each year. Resets to zero at the start of each new year.

Row count

Expanded. Gaps within a year are filled, but completely empty years remain absent.

Watch Out

  • The input must have a time level that is at least as fine as Quarter (Quarter, Month, or finer). Year-level input is not sufficient.

  • Missing periods at the start of a year are not filled. For example, if Q1 is missing but Q2 has data, the YTD starts from Q2.

  • Missing periods within or at the end of a year are filled with the last cumulative value. For example, if Q3 is missing, Q3 and Q4 carry forward the Q2 cumulative total.

  • This function forces the time dimension level links to match the dimension management configuration. Do not use this function if you want the node to have different level links than the dimensions.

  • The related functions QTD (Quarter-to-Date), MTD (Month-to-Date), and WTD (Week-to-Date) work the same way but reset at the start of each quarter, month, or week respectively. WTD is only available on projects that use the week dimension.


Examples

YTD with Missing Quarters

This example shows the year-to-date accumulation over quarters, including how missing quarters inside a year are filled with the latest cumulative value while missing quarters at the start of a year are not added.

Input node: Profit

Year

Quarter

Value

2025

2025-Q1

150

2025

2025-Q2

200

2025

2025-Q3

250

2026

2026-Q2

100

2026

2026-Q3

50

2026

2026-Q4

120

2027

2027-Q1

100

2027

2027-Q2

120

2027

2027-Q4

140

Formula: YTD('Profit')

Year

Quarter

→ YTD Result

2025

2025-Q1

150

2025

2025-Q2

350

2025

2025-Q3

600

2025

2025-Q4

600

2026

2026-Q2

100

2026

2026-Q3

150

2026

2026-Q4

270

2027

2027-Q1

100

2027

2027-Q2

220

2027

2027-Q3

220

2027

2027-Q4

360

2025-Q4 was filled with the cumulative sum (600) because Q3 was the last quarter with data. 2026-Q1 is not in the result because it was missing at the start of the year. 2027-Q3 carries forward the Q2 cumulative (220) because Q3 had no input data.

YTD Across Multiple Dimensions

This example shows how YTD behaves across multiple dimensions with gaps within a year, fully empty years, and a broader project horizon.

Input node: ProfitMultiDim

Product

Year

Quarter

Month

Value

A

2025

2025-Q4

2025-10

50

A

2025

2025-Q4

2025-11

30

A

2026

2026-Q1

2026-01

30

A

2026

2026-Q1

2026-02

40

A

2026

2026-Q4

2026-11

110

A

2027

2027-Q1

2027-01

30

A

2027

2027-Q1

2027-02

50

B

2025

2025-Q4

2025-11

20

B

2025

2025-Q4

2025-12

60

B

2026

2026-Q1

2026-03

70

B

2026

2026-Q4

2026-11

130

C

2025

2025-Q4

2025-12

80

C

2027

2027-Q1

2027-02

100

D

2026

2026-Q1

2026-02

40

D

2027

2027-Q1

2027-01

60

D

2027

2027-Q1

2027-03

70

Formula: YTD('ProfitMultiDim')

Project Horizon: 2024 to 2029

Product

Year

Quarter

Month

→ YTD Result

A

2025

2025-Q4

2025-10

50

A

2025

2025-Q4

2025-11

80

A

2025

2025-Q4

2025-12

80

A

2026

2026-Q1

2026-01

30

A

2026

2026-Q1

2026-02

70

A

2026

2026-Q1 to 2026-Q4

2026-03 to 2026-10

70

A

2026

2026-Q4

2026-11

180

A

2026

2026-Q4

2026-12

180

A

2027

2027-Q1

2027-01

30

A

2027

2027-Q1

2027-02

80

A

2027

2027-Q1 to 2027-Q4

2027-03 to 2027-12

80

B

2025

2025-Q4

2025-11

20

B

2025

2025-Q4

2025-12

60

B

2026

2026-Q1

2026-03

70

B

2026

2026-Q2 to 2026-Q4

2026-04 to 2026-10

70

B

2026

2026-Q4

2026-11

200

B

2026

2026-Q4

2026-12

200

C

2025

2025-Q4

2025-12

80

C

2027

2027-Q1

2027-02

100

C

2027

2027-Q1 to 2027-Q4

2027-03 to 2027-12

100

D

2026

2026-Q1

2026-02

40

D

2026

2026-Q1 to 2026-Q4

2026-03 to 2026-12

40

D

2027

2027-Q1

2027-01

60

D

2027

2027-Q1

2027-02

60

D

2027

2027-Q1

2027-03

70

D

2027

2027-Q2 to 2027-Q4

2027-04 to 2027-12

130

Key observations:

  • All products keep their first value unchanged; nothing is added before the first data point in each year.

  • All periods with at least one value are filled forward until the end of the year.

  • Completely empty years are left out (e.g. B for 2027, C for 2026).

  • No values for 2028 and 2029 (end of horizon) are added, as these would be new years with no data.


Related Functions

Function

When to use instead

QTD

When the cumulative sum should reset every quarter instead of every year.

MTD

When the cumulative sum should reset every month instead of every year.

WTD

When the cumulative sum should reset every week (only available on projects with the week dimension). See: Project Settings

RUNNINGSUM

When you want a running total across the full time axis without a yearly reset.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.