% of total

G

Guest

I have a crosstab query that return the number of members by membership type
in each region (see below):

TRANSFORM Count(tblCustomerData.[Owner Number]) AS [CountOfOwner Number]
SELECT tblCustomerData.[Current Plan Name], Count(tblCustomerData.[Owner
Number]) AS [Total Of Owner Number]
FROM tblCustomerData
WHERE (((tblCustomerData.[Current Club Name])="UR"))
GROUP BY tblCustomerData.[Current Plan Name], tblCustomerData.[Current Club
Name]
PIVOT tblCustomerData.Region;

Is there a way, whether it be through modifying this query or using another
one, to instead of returning a count of each member type per region, return
the % of total member type per region .

As an example lets say that I have member types a, b, and c and regions 1,
2, and 3.

Instead of Returning:

1 2 3

a 5 10 1
b 7 20 13
c 2 3 1

I want to return:


1 2 3
a .3125 .625 .0625
b .175 .5 .325
c .333 .5 .167



can anyone help me out?

Thanks,
Chad
 
G

Guest

Try this ---
TRANSFORM Sum([Owner Number])/[Total Of Owner Number] AS Expr1
SELECT tblCustomerData.[Current Plan Name], Sum(tblCustomerData.[Owner
Number]) AS [Total Of Owner Number]
FROM tblCustomerData
WHERE (((tblCustomerData.[Current Club Name])="UR"))
GROUP BY tblCustomerData.[Current Plan Name]
PIVOT tblCustomerData.Region;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top