Results 1 to 4 of 4
  1. #1
    balboy is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Posts
    2

    Question Help with calculate salary according KPI with incremental bonus value using query or any other way

    Good Day ,

    The Table :

    Click image for larger version. 

Name:	1.PNG 
Views:	10 
Size:	11.4 KB 
ID:	23482

    1)
    I want to calculate emp_salary and emp_total_salary based on emp_kpi(the value will be insert manually between certain ranges) , the emp_bonus will increment

    if emp_kpi ranges between :-



    0 <= 40 ; emp_bonus = 0.05

    0 <= 69 ; emp_bonus = 0.08

    0 <= 100 ; emp_bonus = 0.11

    2)
    the formula to calculate :-

    emp_salary = emp_basic_pay + emp_allowance + emp_travel_cost

    emp_total_bonus = emp_salary * emp_bonus

    emp_total_salary = emp_salary + emp_total_bonus

    3)

    Click image for larger version. 

Name:	2.PNG 
Views:	10 
Size:	71.9 KB 
ID:	23483

    build expression here ?

    4)
    I've been trying googling and stuff since yesterday and unable to do this since this is my first time using microsoft access . I use expression builder with Iif to calculate but still got expression error

    Thank you
    Attached Thumbnails Attached Thumbnails 1.PNG   1.PNG  

  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
    53,626
    What is the exact error?

    The Employee_Salary table is not a normalized structure. Summing data would be easier if each pay item was its own record.

    Arithmetic with Null returns Null. If any field in the expression is Null the result of the addition will be Null. Have to handle possible Nulls.

    Nz(emp_basic_pay,0) + Nz(emp_allowance,0) + Nz(emp_travel_cost,0)

    Info about Null: http://allenbrowne.com/casu-12.html

    Also review: http://allenbrowne.com/QueryPerfIssue.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
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,841
    suggest look at the switch function

    emp_total_bonus = emp_salary * switch(emp_kpi<=40,0.05,emp_kpi<=69,0.08,true,0.11 )

    use true for the last condition if emp_kp can be greater than 100, otherwise you could use emp_kpi<=100

  4. #4
    balboy is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Posts
    2
    Thank you so much for both of your reply,it does help me a lot ! TYSM both of you

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

Similar Threads

  1. Incremental field on query
    By jobrien4 in forum Access
    Replies: 2
    Last Post: 12-28-2014, 10:47 AM
  2. Incremental Number in a Query
    By jmauldin01 in forum Access
    Replies: 5
    Last Post: 01-01-2014, 01:23 AM
  3. Replies: 8
    Last Post: 06-04-2012, 05:14 PM
  4. How to calculate salary in parts
    By jalals in forum Access
    Replies: 6
    Last Post: 05-17-2012, 12:57 PM
  5. Where to Put Instructor Salary?
    By alpinegroove in forum Database Design
    Replies: 54
    Last Post: 01-03-2012, 05:37 PM

Tags for this Thread

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