[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More of the Black Art...



PureBytes Links

Trading Reference Links

Roy,
I don't know if you had seen this, but while I was working on something
else, I needed some way to have a counter from within a Sum( ) function.
Like:

Sum(counter*2,4);

Which would result in:
(1 x 2) + (2x2) + (3x2) + (4x2) = 20

I came up with:

LastValue(Cum(1)+PREV-PREV)-Ref(Cum(1),-1)

as used inside a Sum function like:

X:=Sum(  (LastValue(Cum(1)+PREV-PREV)-Ref(Cum(1),-1)  )*2,4);
X {=20}

I realize this is really ugly, and would appreciate it if you know of a
better incremental counter that could be used within a Sum( ) function.

Thanks,
-Corey Saxe