Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross Tab Distinct Count Problems

Status
Not open for further replies.

Schnappa

Technical User
Jul 27, 2003
58
AU
Hi All

Been searching for awhile to find an answer to this one, hopefully it's a case of shop blindness...

My crosstab (CR 2008 nil sp) provides distinct counts that provide a correct total and distinct percentage of 100%, but the groupings making it up are way over the expected total and way over 100% when added up.

Group Distinct Count Distinct %
A 12,746 36.52
B 9,753 27.94
C 23,770 68.10

Total 34,905 100.00 <-- These are right.

I have been doing these things for years and then all of a sudden this starts happening. All the data is coming from one table (SQL Server 2008).

Can anyone tell me where my brain may have disspeared to....

Cheers

Gezza
 
The percentages are correct. If you look at the data in a detail section, I think you will find that whatever field you are distinct counting appears in multiple groups, so at the group level one field might appear in each of three groups, but at the grand total level, the field is counted only once. You could also tell this by adding a count summary. If you use a count summary with a percentage, the group totals would sum to the grand total, as would the percentages.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top