I have a list of user grouped by the state they live and a count showing how many people are in each state my goal is to also put what percentage each group is out of the total users.
how would I go about creating this?
Thank you
I have a list of user grouped by the state they live and a count showing how many people are in each state my goal is to also put what percentage each group is out of the total users.
how would I go about creating this?
Thank you
Options:
1. Build a report using Grouping & Sorting features and aggregate calcs in group header/footer. Create a group on state field. Calculate total users in report footer. Calculate total users in group footer. Divide group total by report total to get percentage.
2. Build an aggregate query that calculates the total user count. This will result in a single record of the total. Do another aggregate query that totals by state. Include both queries in another query without a join clause. This will cause the single record to join with every record of the state group query. Now can calculate the percentage in this query.
3. Use DCount domain aggregate functions in a query.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I like option1
my State group header
="Total Customers from" & " " & [ST] & ": " & Count(*)
And
my report footer
="Total Customers" & " " & Count(*)
How would I make this percent thing work
Or option 3 sounds good
You can't have the Count(*) concatenated with text. That does not give a value that can be used in subsequent calculations. Put text in label and expression in textbox. Then in a textbox next to the state count, like:
=tbxState / tbxTotal * 100
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.