I have employee payroll transactions that have an overhead value, this value may have changed through out the year so there is another table that includes the overhead history. The overhead history table does not include all employees in it, just ones that have changed.
As per a previous post I was only getting records that actually had the employee in the history table, and we came up with the following.
My Overhead History Table (1) is now linked to the Employee Transaction Table (2) with a "Left Open Link" and my formula is as follows;
if isnull({1.OVERHEAD.EMPLOYEE_NUM}) then {2.TRANSACTION_AMOUNT}*{1.OVERHEAD_PERCENT}+{2.TRANSACTION_AMOUNT }
else
if {2.TRANSACTION_DATE} >= {1.OVERHEAD_HISTORY.START_DATE} and {2. TRANSACTION_DATE } <= {1.OVERHEAD_HISTORY.END_DATE}
then {2.TRANSACTION_AMOUNT}*{1.PA_EMP_OVH.OVH_PRCNT}+{2.TRANSACTION_AMOUNT}
else {2.TRANSACTION_AMOUNT}*{1.OVERHEAD_PERCENT}+{2.TRANSACTION_AMOUNT }
Now I seem to be getting values from both my history table and current table, essentially doubling my totals.
Thanks in Advance.
As per a previous post I was only getting records that actually had the employee in the history table, and we came up with the following.
My Overhead History Table (1) is now linked to the Employee Transaction Table (2) with a "Left Open Link" and my formula is as follows;
if isnull({1.OVERHEAD.EMPLOYEE_NUM}) then {2.TRANSACTION_AMOUNT}*{1.OVERHEAD_PERCENT}+{2.TRANSACTION_AMOUNT }
else
if {2.TRANSACTION_DATE} >= {1.OVERHEAD_HISTORY.START_DATE} and {2. TRANSACTION_DATE } <= {1.OVERHEAD_HISTORY.END_DATE}
then {2.TRANSACTION_AMOUNT}*{1.PA_EMP_OVH.OVH_PRCNT}+{2.TRANSACTION_AMOUNT}
else {2.TRANSACTION_AMOUNT}*{1.OVERHEAD_PERCENT}+{2.TRANSACTION_AMOUNT }
Now I seem to be getting values from both my history table and current table, essentially doubling my totals.
Thanks in Advance.