Results 1 to 5 of 5
  1. #1
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215

    Crosstab Query with Percentages of Total

    I am trying to build a crosstab query that gives percentages rather than counts or averages or other calculations. I'm not quite sure how to do this, though. Any help would be appreciated. Here is an example of the kind of crosstab query I am looking for.




    Jan Feb Mar Apr
    A 5% 80% 90% 100%
    B 90% 10% 0% 0%
    C 2.50% 5% 0% 0%
    D 2.50% 0% 10% 0%


    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    I think percentages are easiest calculated in report where totals can be calculated in group or report footer and the group or detail sections can reference the aggregate controls. However, creating a report to run perpetually based on crosstab query is not easy. http://allenbrowne.com/ser-67.html
    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.

  3. #3
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    I see what you are saying about the controls referencing an aggregate number in the report. That makes sense.

    I was a bit worried I couldn't create a graph of these percents, but you just need to go into Chart Types (in design mode) and select 100% view of the data.

    Thanks!

  4. #4
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    I just ran into an issue with the graphing of these percentages. Yes, you can graph numbers as percentages of a total instead, BUT you can not display the percentages within the graphs - just the number values.

    This means I may have to create a query that will produce those percentage numbers instead. No?

    Thanks,

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    That does sound correct. I've never done such a graph. Will require multiple queries.

    First do an aggregate query that does the summation you want. Then join that query to table. Create a field that calcs percentage. Use that query as graph data source.
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 07-17-2013, 02:34 PM
  2. Percentages Query
    By mabrown81 in forum Queries
    Replies: 12
    Last Post: 11-01-2012, 12:50 PM
  3. Crosstab query - adding percentages
    By bruegel in forum Queries
    Replies: 9
    Last Post: 07-31-2012, 09:50 AM
  4. Replies: 1
    Last Post: 07-05-2012, 11:34 AM
  5. Replies: 5
    Last Post: 09-10-2010, 10:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums