Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Summary question Post Reply Post New Topic
Author Message
swatts
Groupie
Groupie
Avatar

Joined: 17 Mar 2010
Online Status: Offline
Posts: 83
Quote swatts Replybullet Topic: Summary question
     Posted: 29 Aug 2013 at 9:57am
Is there a way to get a summary to average all of the records that do not have a zero?
My records are like:
14
12
7
16
0
15
11
0
6
0
7
8
0
12
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 29 Aug 2013 at 10:05am
One possible solution is to have two running totals, one to add up all the numbers the second to count only when the number is not zero then have a formula to do the average (example: {#allnumbers}/{#countofnonzeros})
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Aug 2013 at 10:26am
you can also just use 1 Running Total with an evaluate formula
field to summarize=field
type = average
evaluate=use a formula
table.field<>0
reset=never
place in report footer
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 30 Aug 2013 at 6:11am
I had forgotten that averages was one of the summary options.  Use DBlank's solution.
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