Skip to main content
Solved

Recursive Calculation using MIN()

  • May 14, 2026
  • 2 replies
  • 13 views

Forum|alt.badge.img+8

Hi All,

Do you know how to implement a recursive calculation using MIN() function?
 

Take this metric for example. The goal is that in a different metric I want the minimum value from TEST 1 except that I want the calculation to be recursive. If I am in Aug24, I want minimum value from Aug24-Apr25, if it is Sep24 then minimum value from Sep24-Apr25 and so on.

Best answer by Laszlo

Hi ​@tjain02 

 

You can utilise the CUMULATE function with a MIN parameter, combined with RANK to look forward for minimum values.

 

CUMULATE('TEST 1', Month ON RANK(Month.'Start Date',0,DESC), 0, MIN)

 

CUMULATE: https://kb.pigment.com/docs/cumulate-function

RANK: https://kb.pigment.com/docs/rank-function

 

Cheers,

Laszlo

2 replies

Laszlo
Master Helper
Forum|alt.badge.img+8
  • Master Helper
  • Answer
  • May 14, 2026

Hi ​@tjain02 

 

You can utilise the CUMULATE function with a MIN parameter, combined with RANK to look forward for minimum values.

 

CUMULATE('TEST 1', Month ON RANK(Month.'Start Date',0,DESC), 0, MIN)

 

CUMULATE: https://kb.pigment.com/docs/cumulate-function

RANK: https://kb.pigment.com/docs/rank-function

 

Cheers,

Laszlo


Forum|alt.badge.img+8
  • Author
  • Master Author
  • May 14, 2026

@Laszlo , This worked! Thank you!