I can offer a couple of strategies here.
I think both are more efficient that the Summation() operator you're currently using. I can't say they are the most efficient possible though.
1) Use the Sum() function on a matrix.
If(Row()<:Moving Avg Window,
.,
Sum( :Current[Index( Row() - (:Moving Avg Window - 1), Row() )] ) / :Moving Avg Window
)
This takes advantage of the speed of the matrix operation. The subscript of the Current column in this formula is a matrix of the row numbers from the start of the moving average window to the current row number. My subscripting the column this way JMP returns a matrix and the Sum function is relatively efficient over a matrix.
An even faster way though is to calculate this moving average over two columns. The first column simply maintains a moving sum by adding the value of Current in one row to the value of the rolling sum in the previous row and then subtracting the value of Current from the row at the beginning of the window.
Here's the formula for Moving Sum.
If(Row()<=:Moving Avg Window,
If( Row() == 1,
:Current,
Lag( :Name( "moving sum(x)" ), 1 ) + :Current
),
(Lag( :Name( "moving sum(x)" ), 1 ) + :Current) -
Lag( :Current, :Moving Avg Window )
)
Then it's easy to have a column that divides Moving Sum by the Moving Avg Window.
If(Row()>=:Moving Avg Window,
:Name( "moving sum(x)" ) / :Moving Avg Window,
.
)
I'm attaching a data table that shows both of these methods. In the data table the Moving Avg Window is a Data Table Variable.
To see the efficiency of the second method in this data table you may want to suppress the evaluation of the of the Moving Avg(x) column first.
-Jeff
-Jeff