Forum Discussion

IvanWeiss's avatar
IvanWeiss
Qrew Captain
2 years ago

Determining current record per employee (payroll compensation history)

Hi everyone, thanks in advance for the help.

I have a "Team Members" Table which is a table of all of my employees.  It is a one to many relationship with a "Compensation" table where I enter all of the compensation for each employee.

On the Team Members table there is a report called "Payroll Sheet" that will be used for bi-weekly payroll.  It prints out the team members name, annual salary, bi-weekly salary, which is used for payroll entry. Currently, I am taking the largest salary for each team member on that sheet.

However, two of the owners have decided to reduce their salary.  So now I do not need the highest salary but I need the most recent (effective date salary).  But I cannot just take the highest effective date as it needs to be before the payroll date.  This way if we decide to give someone a raise in a month we can enter it now but it will not populate on the report until after that payroll date.

So my thoughts are to create a formula checkbox on the compensation table that will be marked check for each employee's salary to use.  I have this code in there so far

//To be the most current salary the following conditions must be met:
//  Salary must be the most recent effective date that is before the payroll date per employee
 
If([Effective Date]<=[Payroll Date],true,false)
What I cannot figure out is how to limit this to (1) checked entry per Team Member and how to take only the most recent effective date.  
Any thoughts?


------------------------------
Ivan Weiss
------------------------------
  • Ivan,

    This should do it.

    When you create the Pay Roll record, fire a Pipeline that searches for the Salary History record for the Related Team Member where

    Pay Roll Date OAF Start Date AND 

    Pay Roll Date OBF Stop Date

    Now you just use the Salary from the Compensation table as a Look Up field for all your calculations.



    ------------------------------
    Don Larson
    ------------------------------
    • IvanWeiss's avatar
      IvanWeiss
      Qrew Captain

      Hi Don, sorry for the slow response.  Heavy travel week!  So I could convert to something like this.  However, today I do not create a "payroll record". I just run a report off of the team members table.  I am not sure I have the need to actually record the payroll as a record although perhaps it would be an interesting idea as if I made the lookup/summary fields snapshots I guess it would record what was paid in that instance.

      Thoughts on doing it without that payroll table or you think that is the best implementation?



      ------------------------------
      Ivan Weiss
      ------------------------------
      • DonLarson's avatar
        DonLarson
        Qrew Elite

        Ivan,

        Having Payroll History is valuable for lots of reasons.  However here is a way to do this without a payroll table.

        Make a Formula Check Box field on the Compensation table that will go to true in the Payroll Period

        Then summarize the Record ID of that Compensation record on the Team Members table.

        Then make another relationship between Compensation and Teams where the Summary field is the Reference Field

        Then make Salary a Look Up field in Teams.

        That should always give you the salary for the current period.

        The formula check box logic can get tricky for these types of questions.



        ------------------------------
        Don Larson
        ------------------------------