PREVIOUSITEM() - PREVIOUS() on a list
Referring to the previous item in a list is a nightmare: You can write a lookup to find the previous item, but as soon as you try to use it you get a circular reference. Sometimes you can get round this with creative use of the CUMULATE() function on your list, but sometimes you can't and you need to map your calculation onto the time dimension.
But if CUMULATE() can be used on a list, why not PREVIOUS()? It would be awesome to have a PREVIOUSITEM() function that allowed you to pick up a value from the previous item in a list, while letting Anaplan know that you're not creating a circular reference. You can be sure it's not a circular reference because the dependencies would always flow in the direction of the list, and it would solve all sorts of problems.
We're always saying "If you can do something in Excel, you can do it in Anaplan," but recursion is an example (possibly the only example?) of something that's simple in Excel but virtually impossible in Anaplan. Excel can handle recursive calculations on any dimension, but Anaplan can only really handle recursion over the time dimension. This would solve that.
PREVIOUSITEM(x, y) where
- x: Any expression
- y: List
The expression x must be based on the list y. PREVIOUSITEM(x, y) would then pick up the value of x from the previous item in the list y.
Anaplan would need to allow PREVIOUSITEM(x, y) to be used in the definition of x itself, in the same way as PREVIOUS(), without creating a circular reference.