Results 1 to 2 of 2
  1. #1
    Alex_622 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    1

    CrossTab Query to Achieve a Cumulative Total

    Hello All,



    First of all, I'm relatively new to Access, so this may be a simple problem, but I could not find a solution anywhere online.

    Basically, I have a Crosstab Query with policy durations (numbers 1-25) on the left as my row headers, and group codes along the top as my column headers. The query I have at the moment successfully produces a sum of the Face amounts for the intersection of each field (i.e. sums all amounts for Group Code = "10NP30" where Duration = 10). Obviously the details of the data is not important, just the concept. Below is a rough idea of what it looks like with made-up data, in case my explaination was a bit vague. I can't seem to get the sample data to be spaced properly in the post, but just imagine row/column headers and a 3X5 dataset.

    NP10 NP15 SIWL.....
    1 100 250 340
    2 30 80 200
    3 25 130 150
    4 70 90 80
    5 80 25 270
    ... ... ... ...
    25 4 7 13

    So my next goal is to simply get a cumulative/running total, basically using a "greater than" criteria instead of "equal to" for Duration. For example, I'm looking for the first row to be a sum of all Face amounts for policies in the given Group Code categories for all Durations >= 1, the next row is the sum for all durations >= 2, then Durations >=3, etc., until the 25th row is simply for Duration = 25.

    Has anyone encountered this type of problem before/know a way to accomplish this? I wish it was an easy in Access as it would be in Excel! Any help is appreciated, I'm happy to further clarify anything that is still unclear about the problem.

    Thanks!!!
    -Alex

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,526
    use a maketable to post the crosstab table to a table (with empty Cummu field)
    then run a vb code to go thru and sum that field.
    or
    use a report ,it can do running totals. Set the field property running total = true.

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

Similar Threads

  1. Cumulative total error in query
    By maxmaggot in forum Queries
    Replies: 13
    Last Post: 06-22-2013, 07:51 PM
  2. Using dsum to return a cumulative total
    By tomnsd in forum Queries
    Replies: 7
    Last Post: 04-01-2013, 01:16 PM
  3. Running Total (Cumulative)
    By jamesborne in forum Queries
    Replies: 3
    Last Post: 12-26-2011, 09:30 PM
  4. cumulative total
    By afshin in forum Queries
    Replies: 14
    Last Post: 08-11-2011, 01:42 AM
  5. Cumulative total in query
    By MikeWaring in forum Queries
    Replies: 2
    Last Post: 12-18-2010, 01:40 PM

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