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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I add percent to a cross-tab report?

Status
Not open for further replies.

bhfmc

IS-IT--Management
Jun 18, 2003
29
0
0
US
In spite of some effort in reading FAQs, I haven't figured out how to add a percentage column to a cross-tab report.
The (simplified) report looks like this now:
Female Male Total
Black 4 6 10
White 16 14 30
Total 20 20 40

I'd like it to look like this:
Female Male Total
Black 4 20% 6 30% 10 25%
White 16 80% 14 70% 30 75%
Total 20 100% 20 100% 40 100%

Each person (row in the full 8.5 v. CR) has a unique ID.

In FAQs, I did not understand what a "manual cross-tab" is. I added a "counter" formula field (times 100), but the field name doesn't show up when I format cross-tab and try to choose it as a summarized field. Suggestions?
 
A "manual crosstab" means that instead of inserting a crosstab, you create one by using formulas. In your example, you would create detail formulas like:

{@female}:
if {table.gender} = "Female" then 1

{@male):
if {table.gender} = "Male" then 1

Insert these at the detail level. Insert a group on {table.ethnicity}, and then insert summaries (sums, not counts!) on these at the group and the grand total level. For the total value for each group instance, just insert a count on the unique ID field, again for both groups and report levels.

Then go back and on each detail formula insert another summary--choose sum (use count for the total column) and "Show as a percentage of the grand total". This will appear on top of your earlier summary, so just drag it to the location you want. For the grand total percentages, you could just enter "100%" in text boxes, as the group percentages will always add to this.

Then suppress the details section.

-LB
 
Thank you, lb. I think I can do that. I'm a bit surprised and disappointed that percentage doesn't just fall out of the insert cross-tab feature. I was beginning to like it so well.
 
I'm not certain, but I believe CR 9.0 may add this feature. It might be worth looking into if you use crosstabs a lot.

-LB
 
LB,
I'd like to take the plunge from 8.5 to 9.0, but I don't want to drown in a flood of alterations that are necessary in order to maintain the format of existing .rpt files. I'd be a bit more courageous about this move if someone could assure me that percentages within cross-tab 9.0 is as simple as I think it should be and that conversion is relatively painless and that I can gracefully run 8.5 and 9.0 concurrently until I'm swimming effortlessly in 9.0 waters. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top