Example: Calculate Worker Age as of July
This example illustrates how to create nested calculations.
To determine worker eligibility for bonuses, you want to identify workers who are 25 or younger on July 31st of the year when the bonus is paid.
As calculations have limited numbers of operands, you need to create multiple calculations and nest them. The nesting determines the order of operation, if you don't specify an
Order
in the calculation.To calculate July 31st of the year of the worker's payment, you need to:
- Determine the year of the payment date.
- Calculate July 31st of that year.
Then to calculate a worker's age, you need to calculate the difference between:
- The worker's date of birth.
- July 31st of the year of the worker's payment.
Security:
- Set Up: Calculations - Genericdomain in the Core Payroll functional area.
- Set Up: Time Off (Calculations - Generic)domain in the Time Off and Leave functional area.
- Access theCreate Build Date Calculationtask.Enter these settings:OptionValueNameDate: July 31 Current Year (based on Payment Date)CategoryPayrollYearYear: Payment Date - YearMonth7Day31
- Access theCreate Date Difference Calculationtask.Enter these settings:OptionValueNameWorker Age as of July Current Year (based on Payment Date)CategoryPayrollIntervalYearStart DateWorker: Date of BirthEnd DateDate: July 31 Current Year (based on Payment Date)