New Column( "ColSum4",
Formula(
myAGE = :age;
myname= :name;
Col Sum( show(myname,myAge,:name,:age,"-");:age == myAGE );
)
);
is quite illustrative. Col cumulative behaves a bit different from how I exected it to behave.
I guessed Col Sum evaluates the arguemt once and then groups/collects the results according to groupBy.
But actually:
Formula is evaluated for every row, in total 40x for rows RWx.
And with every iteration, Col Sum evaluates it's argument 40 times - for every row RWy.
I guess it tries to cache the result and won't evaluate the argument again for other RWx if it can be sure that it will be the same result.
But in the case of Show() or :age = myAGE, it has to evaluate again and again.
-> in total 40 x 40 times.
so ,e.g. for row RWx = 3 (myName = Jane) , it evaluates the argument 40 times.
And for 8 of the 40 RWy, :age == myAge results in 1. So Col Sum is 8 for row 3.
Accordingly, Col Sum is 3 for row 40.