In this example, you'll define an expression that overrides the years of service for an employee that is used to automate the redundancy of employment termination payments.
First, create a variable name to define the expression, such as Expression - Genuine Redundancy.
Next, create the following calculated parameters for the following:
- YearsOfService (which is based on the earning definition named AU_Years of Service From TerminationUI)
- AnnualSalary (which is based on the earning definition names Annual Salary)
For this example, you will configure and calculate payments based on the following redundancy payout and continuous service period:
| Period of continuous service | Redundancy pay |
|---|---|
| At least 1 year but less than 2 years | 4 weeks |
Using the expression, Redundancyautocalculation and the parameters to create the following statement:
Weeklywage = AnnualSalary/52
if (YearsOfService >=1 && YearsofService <=2) {
RedundancyAutoCalculation = Weeklywage * 4};}
Then use the return statement to pass the calculated value to Dayforce:
return
RedundancyAutoCalculation;
The entire expression looks like:
Weeklywage = AnnualSalary/52
if (YearsOfService >=1 && YearsofService <=2) {
RedundancyAutoCalculation = Weeklywage * 4};}
return
RedundancyAutoCalculation;
To ensure that the expression works as expected, pass it in the following test values:
- Annual Salary = $50,000
- YearsOfService = 1.5
Click Calculate to return a result of RedundancyAutoCalculation = $50,000/52*4=$3846.15