Oracle Fast Formulas - Chapter 40: Fast Formula for Absence Duration Calculation

 Chapter 40: Fast Formula for Absence Duration Calculation


Overview:

In Oracle Fusion HCM, Fast Formulas are commonly used to calculate absence durations. This allows for precise tracking of employee leaves based on start and end dates, scheduled work hours, and absence types. The calculated value can be used for absence plans, accruals, or reporting.


Key Use Cases:

  • Compute total duration in days or hours for a given absence.

  • Adjust duration based on work schedules or public holidays.

  • Apply custom rules for partial days, half-days, or shift-based absences.


Sample Fast Formula for Absence Duration (in Days):

DEFAULT FOR START_DATE IS '1900/01/01' DEFAULT FOR END_DATE IS '1900/01/01' INPUTS ARE START_DATE, END_DATE DURATION_DAYS = (END_DATE - START_DATE) + 1 RETURN DURATION_DAYS

This basic formula calculates the total number of days, including both start and end date.


Advanced Scenario (Excluding Weekends):

DEFAULT FOR START_DATE IS '1900/01/01' DEFAULT FOR END_DATE IS '1900/01/01' INPUTS ARE START_DATE, END_DATE DAYS = 0 CUR_DATE = START_DATE WHILE CUR_DATE <= END_DATE LOOP IF TO_CHAR(CUR_DATE, 'D') != '7' AND TO_CHAR(CUR_DATE, 'D') != '1' THEN DAYS = DAYS + 1 END IF CUR_DATE = CUR_DATE + 1 END LOOP RETURN DAYS

This version excludes Saturdays (7) and Sundays (1) assuming Sunday is the first day of the week.


Integration Context:

  • Used in Absence Plans and Policies

  • Can be triggered in Absence Type setup

  • Helps drive leave accruals, validation rules, and proration logic


Practice Quiz:

  1. How can you modify the formula to consider half-day leaves?

  2. Which date functions are used in duration calculation?

  3. What is the difference between "Absence Entry" and "Absence Duration" formulas?

No comments:

Post a Comment