Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 12 Jun 2008 at 9:55pm
I answered this in a post a while back. Try searching for it to track it down.
The basic idea is to have an array with as many elements as you need for the moving average. Then every time you read in a new element, you have to 'shift' the array to drop the old element and add the new one. Then add them all up to get the new average value.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum