Avatar of DarthCook
DarthCook asked on

Calculate average in cross tab even if column is zero

A have a database which records incidents on three sites, i want to be able to display a cross tab in crystal reports XI showing the  total number of incidents by site grouped by month and the average. Only problem is the average column doesn't calculate properly here is an example of my cross tab with the summarised columns.

See example of cross tab attatched
This is what I get when looking at 3 sites over a 2 month period, in December 07 the average should be 5 ( total of 15 / 3 sites) but as site B didn't have any incidents in December it looks like the report isn't actually counting site b to calculate the average I'm not sure if I can show this using a cross tab?

My database query returns the information for the report in the following format.

ID        Date              Site
1        01/12/2007    site A
2        03/12/2007    Site B


Any help is greatly appreciated

Crystal Reports

Avatar of undefined
Last Comment
Mike McCracken

8/22/2022 - Mon
Mike McCracken

That is the way Crystal calculates an average since to it it only had 2 sites in Dec 07.

Does this happen often?

You might have to use a manual crosstab


Yeah it happens quite often when you start looking at lots of sites over a longer time periods, I did think that maybe it would require going down the manual route but was hoping there may be some way to get round it and preserve the formatting of my reports?

Mike McCracken

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck