Results 1 to 3 of 3
  1. #1
    bruce24444 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2014
    Posts
    2

    Need Query to perform calculation based on results

    I have a working database that I designed a couple years ago which we use at work to keep track of the amount of claims that are assigned to each employee. What I am trying to do is now assign a factor to these claims based on complexity so that when I am assigning a new claim I can estimate the workload each employee has and not just how many claims.



    Each type of loss has been assigned a factor and I created a crosstab query which produces a list of how many level 1 claims, level 2 claims ...... what I need now, is a total based on these results but this total is to be multiplied by the factor.
    IE: Brad has 8 level 1 claims, 1 level 2 claim, 9 level 3 claims, 2 level 4 claims and 1 level 5 claim. I want a total to be 50. (8x1) + (1x2) + (9x3) + (2x4) + (1x5)

    If any one can help, it would be greatly appreciated.

    Click image for larger version. 

Name:	Year_Factor_Crosstab.png 
Views:	15 
Size:	19.1 KB 
ID:	15206

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Query1

    SELECT Table1.FirstName, Table1.Factor, Sum(Table1.Factor) AS SumOfFactor
    FROM Table1
    GROUP BY Table1.FirstName, Table1.Factor;

    Query2

    TRANSFORM Sum(Query1.[SumOfFactor]) AS SumOfSumOfFactor
    SELECT Query1.[FirstName]
    FROM Query1
    GROUP BY Query1.[FirstName]
    PIVOT Query1.[Factor];

    All-In-One

    TRANSFORM Sum(Query1.[SumOfFactor]) AS SumOfSumOfFactor
    SELECT Query1.[FirstName]
    FROM (SELECT Table1.FirstName, Table1.Factor, Sum(Table1.Factor) AS SumOfFactor
    FROM Table1
    GROUP BY Table1.FirstName, Table1.Factor) AS Query1
    GROUP BY Query1.[FirstName]
    PIVOT Query1.[Factor];
    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
    bruce24444 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2014
    Posts
    2
    Thanks for the quick response. Once I created Query 1, it returned the results I needed

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

Similar Threads

  1. Replies: 1
    Last Post: 10-08-2012, 03:35 PM
  2. Tricky calculation to perform
    By leeli67 in forum Access
    Replies: 122
    Last Post: 04-15-2012, 05:06 PM
  3. Replies: 1
    Last Post: 08-11-2011, 12:48 PM
  4. Replies: 10
    Last Post: 07-02-2011, 11:51 AM
  5. SQL expression to perform a calculation
    By springboardjg in forum Queries
    Replies: 1
    Last Post: 05-20-2011, 06:57 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