Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Crystal Report Averages BY Group Post Reply Post New Topic
Author Message
bryanrevelant
Newbie
Newbie


Joined: 03 Apr 2015
Online Status: Offline
Posts: 8
Quote bryanrevelant Replybullet Topic: Crystal Report Averages BY Group
     Posted: 08 Jun 2015 at 8:27am
Hello, I see that this has been asked several times however I seen no solution for my issues.

I want averages by Group/location

Database

People, Days, Location
Bob      10    3B
Joe      5     4B
Bryan    90    3B

I want average days by location can this be done in Crystal reports?
IP IP Logged
Erik
Groupie
Groupie
Avatar

Joined: 05 Dec 2013
Online Status: Offline
Posts: 50
Quote Erik Replybullet Posted: 08 Jun 2015 at 10:31am
Group by Location, but keep your field results in the Details so that they still display all the records you want.

Then create a formula for Location specific data and place it into your Group Header or Group Footer.

sum({table.days}, {@Location}) / distinctcount({table.location_field}, {@Location})

You'd probably want this in your footer so that the Group Name (the Location) can be in the Header for label purposes. Otherwise your label would need to go into the Page Header or Report Header unless you added another Group By on a value that is unique for each record, in which case you could have that unique value as Group #1 and use that Group Header for any labels needed on Group #2.


Edited by Erik - 08 Jun 2015 at 10:39am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jun 2015 at 3:19am
I might be missing something in your post but I think you can also just use a crosstab with the location as your row group and the summary of the days set to an average
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