Results 1 to 4 of 4
  1. #1
    harryklein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    48

    Aggregation based on subcategories

    Hi,
    I am not experienced on aggregations, and now I have a task to do it.
    I hava a table like this



    ID, CliendID, ContactdID, SubID, Revenue, Volume. ContractId is not unique

    I would like add the aggregated(SUM) Value of Revenue-s to the Volume-field based on the ContractID.

    I mean there are 3 rows in the table where ContractID="A", and the aggregated Revenue of these is 10, I need to have 10 in Volume-field in every row where Contract="A".

    Thanks a lot

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Can you give us an example of the data that you have and the result that you require
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    ContractID vs ContactID? confusing.
    Agree with Bob, some sample data would be helpful.
    You typically aggregate on a group. What is the group involved? You would not normally show the aggregated value for individual records.

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    It would be handy to see some example data and the desired output as Bob has asked, but something like
    Code:
    SELECT ContractID,  Sum(Revenue) as Volume 
    FROM YourTable
    Group By ContractID
    

    You should not store this value - but always calculate it.
    Also is it Contract or Contact ? You have referred to both in your post.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Replies: 1
    Last Post: 08-15-2019, 12:22 PM
  2. Replies: 1
    Last Post: 03-07-2019, 09:10 AM
  3. Beginner - Categories and Subcategories
    By gr_96 in forum Forms
    Replies: 3
    Last Post: 01-07-2018, 02:07 PM
  4. Aggregation Query doubt
    By akshayajmani in forum Access
    Replies: 4
    Last Post: 10-24-2012, 11:52 PM
  5. Different aggregation levels
    By mod2000 in forum Queries
    Replies: 1
    Last Post: 08-11-2011, 07:27 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