Percent of Total

J

Josh-man

I have created a report that subcategorizes customers
into certain (multiple)demographics. I have 3 queries
that are structured so that the customers are selected
from a max date in the first query. The second query,
allows me to categorize them into a group based off a
group (the demographic)ID number. Finally, the 3rd query
is a parameter query that ties the group (demographic)ID
number to the group ID name.

In the report, I have an unbound text box that counts the
number of customers, based on Last Name, falling into
that particular demographic. What I can't figure out is
how to determine the percentage of customers falling in
that category based on the total number of customers.
Example, if 33 customers fall into this category, and I
have 900 customers, how do I have Access determine that
percentage?

I created a query based on CustomerID that counted the
number of Customer ID's. Seems easy so far. When
combining this query with the aforementioned queries,
that number seems to only correlate with the total number
of customers falling into the demographic, despite my
join properties. Am I approaching this right, or should
I use an expression in an unbound text box in the report
that allows me to count the total number of customers
from the customers table.
 
M

Marshall Barton

Josh-man said:
I have created a report that subcategorizes customers
into certain (multiple)demographics. I have 3 queries
that are structured so that the customers are selected
from a max date in the first query. The second query,
allows me to categorize them into a group based off a
group (the demographic)ID number. Finally, the 3rd query
is a parameter query that ties the group (demographic)ID
number to the group ID name.

In the report, I have an unbound text box that counts the
number of customers, based on Last Name, falling into
that particular demographic. What I can't figure out is
how to determine the percentage of customers falling in
that category based on the total number of customers.
Example, if 33 customers fall into this category, and I
have 900 customers, how do I have Access determine that
percentage?

I created a query based on CustomerID that counted the
number of Customer ID's. Seems easy so far. When
combining this query with the aforementioned queries,
that number seems to only correlate with the total number
of customers falling into the demographic, despite my
join properties. Am I approaching this right, or should
I use an expression in an unbound text box in the report
that allows me to count the total number of customers
from the customers table.


Since your report's query does not have one record for each
customer, it can not tell you how many customers there are
in the table. If you really want to base the percentage on
every customer in the customers table, then use a text box
(named txtTotalCustomers with an expression that calculates
the count of all of them:

=DCount("*", "Customers")

Now the percentage text box can calculate the demographic
percent:

=Count(*) / txtTotalCustomers
 

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