Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Average of a Summary Post Reply Post New Topic
Author Message
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Topic: Average of a Summary
    Posted: 09 Oct 2014 at 10:17pm
Good morning,

I currently have a formula that is working out the Daily Growth based on an Average of each days disk size (grouped by day): http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=21098.


What I would now like to do is to create (in the Report Footer if possible) an Average Daily Growth. For example I currently have the following:


Date, Computer, Disk, Disk (MB), Avg Used (MB), Daily Difference

02/10, Comput1, D1, 100, 60, 0
03/10, Comput1, D1, 100, 68, 8
04/10, Comput1, D1, 100, 65, -3
05/10, Comput1, D1, 100, 80, 15

So I would like to average the Daily Difference column to give me this in the footer:

Average Daily Growth: 5


The main problem being that I obviously can't summarise a summary (Daily Difference).

Thanks in advance!!
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 10 Oct 2014 at 7:15am
You could make a manual average using a formula and shared variables.
I am guessing on field names.  You would put the following formula in the section where you are displaying the above information.

shared numbervar dailydiff;
shared numbervar recordcnt;
dailydiff :=dailydiff + {Daily Difference};
recordcnt := recordcnt +1;

Then in the report footer put
shared numbervar dailydiff;
shared numbervar recordcnt;
dailydiff/recordcnt

Hopefully this will work for you.
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 13 Oct 2014 at 3:25am
Thank you for your reply. I have been able to achieve what was required by using an Array Variable.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.014 seconds.