Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Summarize formula that uses Next function Post Reply Post New Topic
Author Message
vineet85
Newbie
Newbie


Joined: 11 Jan 2011
Location: United States
Online Status: Offline
Posts: 1
Quote vineet85 Replybullet Topic: Summarize formula that uses Next function
     Posted: 11 Jan 2011 at 11:52am
I have a formula to calculate the time difference between two records for which I use the next function in crystal. Now I would like to get an average time difference. I am not allowed to use the summary formula due to the next function. Is there an alternative way to getting this done ?
 
Thanks.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 12 Jan 2011 at 4:36am
you need to keep track of you sum (the values you are getting with your formula) and keep track of the number of items, then where you want to use the average, create a formula that uses the sum and the count to create an average, and place that on the report.
 
CR can't use the aggregate functions on calculated value like your formula as it can't divine the values by just looking at the raw data, it has to read each value to determine what you want.  If it made another pass through data it could it, but it doesn't....that's why you get the 'big bucks'.
 
as a last note, the variables should be global or shared so that they persist for the report, and might need to be reset at some point...depending on the report's criteria.
 
HTH
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