Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Cross Tab Summary Post Reply Post New Topic
Author Message
Evil McBad
Newbie
Newbie
Avatar

Joined: 06 Feb 2008
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Evil McBad Replybullet Topic: Cross Tab Summary
     Posted: 12 Mar 2009 at 9:46am
Hi - I'm using CrystalXI and i have a cross tab problem.
 
My cross tab shows distinct count of case id numbers for each of a number of categories.  The problem is, that the column totals don't equal the sum of the records within the cross tab.  I know why this is, its because case ids can appear under more than one category - therefore they are counted twice ( or more) within the body of the crosstab, but only once in the summary - like this:
 
                              ofiice1     office2   office3
Total                        10            8          6
category a                  5           4          2
category b                  6            5         4
 
How can I get my totals to display the actual total of the cell values?  IE 11, 9 & 6 in the example above.
 
Thanks
 


Edited by Evil McBad - 12 Mar 2009 at 9:47am
Evil
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2009 at 9:53am
Change your cross tab group summary option from DistinctCount to Count
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2009 at 9:58am
Just a note that this will also increase your numbers at the category level if there are multiples case ids per category.
IP IP Logged
Evil McBad
Newbie
Newbie
Avatar

Joined: 06 Feb 2008
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Evil McBad Replybullet Posted: 12 Mar 2009 at 9:58am
Yeah - I thought of that, unfortunately I only want to count each case id once under each category and they can appear more than once.
Evil
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2009 at 10:00am

May I ask why you only want them to show once at the Cat level but more than once at the Upper level. That would be confusing the data somewhat?

IP IP Logged
Evil McBad
Newbie
Newbie
Avatar

Joined: 06 Feb 2008
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Evil McBad Replybullet Posted: 12 Mar 2009 at 10:06am
yes, I know it sounds odd - but the requirement is to understand how many times a case is logged under each category (but not count duplicates) and then how many this represents in total.
 
It's a database of antisocial behaviour and one perpetrator (case id) can appear several times  under different categories- (under 'noise', 'neighbour nuisance' etc) and have several individual incidents within those categories , but the requirement is to understand in total what categories cases fall into.
 
That probably sounds like gobbldygook.
 
I've tried using the formulas within the format field function but have to confess that I ddon't really know too much about how they work.
Evil
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2009 at 10:13am
Well I think you are going to be a little stuck if you have to use a Crosstab. Formulas are not going to help much here because anything you do would require variables which will not be useful in the crosstab.
 
The only way round it for a crosstab that I can think of is to filter the data before pulling it into the report to get only one record per ID per category then you can just use the COUNT. This would mimic the distinct count at the category level but a total sum of all records at the top level to incluse your "duplicates" at each category level.
If you are using SQL you could create a view using the category, office and id# and group on them all.
IP IP Logged
Evil McBad
Newbie
Newbie
Avatar

Joined: 06 Feb 2008
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Evil McBad Replybullet Posted: 12 Mar 2009 at 10:57am
I was kind of coming to that conclusion - I'll create a view as you suggest.
 
Sincere thanks for taking the time to respond.
Evil
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