Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Moving Average Post Reply Post New Topic
Author Message
wcole4
Newbie
Newbie


Joined: 12 Jun 2008
Location: United States
Online Status: Offline
Posts: 5
Quote wcole4 Replybullet Topic: Moving Average
     Posted: 12 Jun 2008 at 3:54pm
I need help calculating a moving average.  Can someone point me in the right direction?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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>
IP IP Logged
wcole4
Newbie
Newbie


Joined: 12 Jun 2008
Location: United States
Online Status: Offline
Posts: 5
Quote wcole4 Replybullet Posted: 13 Jun 2008 at 8:22am
I searched the fourm before posting.  Just searched and only post I can find is one from Feb who asked same question.  Can you repost?
IP IP Logged
Printable version Printable version

Forum Jump
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