thread767-1487073
Hello,
I've been able to modify and use the rolling average code from the thread referenced above, but now I need it to be able to handle data sets that produce arrays greater than 1000 elements. I believe this can be done by creating multiple arrays as seen on page 10 in the following link ( but I'm having some trouble implementing this approach. Any and all help would be greatly appreciated. Below is the code I'm currently working with. Thanks.
numbervar the_field_NOx := {Sheet1.NOx};
numbervar array Accum_NOx;
numbervar Rolling_Period := 12;
if OnFirstRecord then
ReDim Accum_NOx [1]
else
ReDim Preserve Accum_NOx [UBound(Accum_NOx)+1];
Accum_NOx [UBound(Accum_NOx)] := the_field_NOx;
If UBound(Accum_NOx) <= Rolling_Period then
Sum(Accum_NOx)/12
Else
sum(Accum_NOx[(UBound(Accum_NOx) - (Rolling_Period-1)) to UBound(Accum_NOx)])/12;
Hello,
I've been able to modify and use the rolling average code from the thread referenced above, but now I need it to be able to handle data sets that produce arrays greater than 1000 elements. I believe this can be done by creating multiple arrays as seen on page 10 in the following link ( but I'm having some trouble implementing this approach. Any and all help would be greatly appreciated. Below is the code I'm currently working with. Thanks.
numbervar the_field_NOx := {Sheet1.NOx};
numbervar array Accum_NOx;
numbervar Rolling_Period := 12;
if OnFirstRecord then
ReDim Accum_NOx [1]
else
ReDim Preserve Accum_NOx [UBound(Accum_NOx)+1];
Accum_NOx [UBound(Accum_NOx)] := the_field_NOx;
If UBound(Accum_NOx) <= Rolling_Period then
Sum(Accum_NOx)/12
Else
sum(Accum_NOx[(UBound(Accum_NOx) - (Rolling_Period-1)) to UBound(Accum_NOx)])/12;