How do I “disaggregate” a series?

Series which are aggregated annually can be “deaggregated” by using an If() statement in the formula language.


If(Counter()=StartOfYear(), cngpfi0091, Momentum(cngpfi0091, 1))

The logic of this formula is: keep the first value of each year as given, but the subsequent values in that year are calculated by subtracting the previous value from the current value.