So this is my first post and its probably a really dumb question but I cannot get my head around a proper algorithm to handle the following situation.
I have a dataset that contains employees who have left an organisation, employees who have started at the organisation, and employees who havent either left or start at the organisation.
Example 1:
EmployeesStart: 0
EmployeesGone: 0
EmployeesRemain: 50
Example 2:
EmployeesStart: 10
EmployeesGone: 20
EmployeesRemain: 100
Example 3:
EmployeesStart: 0
EmployeesGone: 29
EmployeesRemain: 9
I am looking for an algorithm that determines the number of employees given these numbers.
Initially I thought
CurrentEmployees = EmployeesRemain + EmployeesStart - EmployeesGone
which would be correct for the first 2 examples but in example 3 I would end up with -20 employees which is incorrect.
Is there a simple sum I can use to get this correct, or do I have to come up with an algorithm to deal with each of the possible scenarios (e.g. Employees Gone > Employees Remain, Employees Start = Employees Gone, ect)
The terms are not well defined. you either need to modify the term employeesstart, or define a new term "initial employees." Employees start probably means employees entering, not who were there initially. In that case example 3 would make more sense.
EmployeesRemain has to be $\ge 0$
EmployeesInitial = EmployeesGone + EmployeesRemain - EmployeesEnter
So in this case Currentemployees = employeesremain, but there are other possibilities depending on who left when and what group is included in the other. Without concise definitions, you may not be able to generate a definite result.