This page covers three functions: OnChangeλ(), OnChangeCountλ(), and OnChangeResetλ().Their purpose is to detect a change in an array and change a counter. Each of these functions require a 'source array' as an argument. Each of these produce an output array of equal size and shape. The contents of that output array change based on the function as described below.
OnChangeλ() creates an array and places a 1 in each array position where the source array's values change. In our example we want a flag (1) where the timeline's year changes.
OnChangeCountλ() creates an array and increments a counter when the source array's values change. In our example we start with 1 and add 1 when the timeline's year changes.
OnChangeResetλ() creates an array and increments a counter when the source array's values remain the same change and resets the counter when the source array's values change. In our example we count each period within a year.
OnChangeλ( Array)
Array
(Required) An array of values to analyze
OnChangeCountλ( Array, [Start] )
Array
(Required) An array of values to analyze
Start
(Optional) the counter's starting value
OnChangeResetλ( Array)
Array
(Required) An array of values to analyze
In this example we look for when the timeline's year changes.