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!

Percent in crosstab

Status
Not open for further replies.

kvena

Technical User
Aug 5, 2005
19
US
I have a cross tab report that looks like this:
Corporation Foundation Group

Urban $5000.00 $4500.00 $300.00
5 1 2

Rural $4000.00 0 $50.00
5 0 2

I want to find out the percent for each urban and rural count by constituency type. For Example.

Corporation Foundation Group
Urban 50% 100% 50%
Rural 50% 0% 50%


Can this be done in a cross tab?
 
Depends on your software version, please take the time to post the basics.

It's probably under the Summarized Fields->Change Summary and select the Show as a percentage of for your field.

-k
 
It is almost always critical that you report your CR version, and it is especially true when working with crosstabs.

-LB
 
If you can use SQL expressions, you can do the following. Create two SQL expressions:

[%cell:]
(select count(A.`customerID`) from Table A where
A.`Constituency` = Table.`Constituency` and
A.`Environment` = Table.`Environment`)

[%coltot:]
(select count(A.`customerID`) from Table A where
A.`Constituency` = Table.`Constituency`)

You need to substitute your exact field names and replace "Table" with your table name. Leave "A" as is, as it represents an alias table name.

Then create a formula {@percent}:

if {%cell} > 0 then
{%cell} % {%coltot}

Add the formula as a summary field in your crosstab. Exit the crosstab and then right click on the summary and change the summary to a maximum (if you do this while in the crosstab, you might get a Dr. Watson). Then while the summary is selected, click on the % sign in the toolbar. This will give you the correct percentages within the inner cells of the crosstabs. If you wanted to also show the percentages in the total row, you would have to overlay a second crosstab with a different calculation.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top