ANS-0183 · SAVED SEARCHES & FORMULAS
How to Calculate Vacation Accrual Using a Custom Saved Search Formula in NetSuite
Explore a custom SQL formula for calculating employee vacation accrual, noting that NetSuite's native Time-Off Management features offer more comprehensive solutions.
Short answer
While NetSuite's native Time-Off Management and Payroll features are the recommended approach for vacation accrual, a custom SQL formula in a saved search can be used for specific scenarios. This formula calculates accrual based on hire date, current date, and a custom vacation rate, with an approximation for weekend days.
Scenario
Organizations often need to calculate employee vacation accrual based on various factors such as hire date and a defined accrual rate. While NetSuite offers dedicated Time-Off Management features, some specific or legacy requirements may necessitate a custom solution, such as a saved search formula.
Solution
NetSuite's dedicated Time-Off Management and Payroll features are generally the recommended approach for managing vacation accruals, offering integrated and configurable rules. However, for specific custom reporting or legacy requirements, a custom SQL formula within a NetSuite saved search can be employed to calculate vacation accrual.
The following formula calculates vacation accrual, considering the employee's hire date, the current date, and a custom vacation rate. It's important to note that the method for approximating weekend days in this formula may not be as accurate or comprehensive as NetSuite's built-in work schedule and time-off management capabilities.
TO_CHAR( ( (CASE WHEN TO_CHAR({hiredate},'YYYY')
TO_CHAR(sysdate,'YYYY') THEN sysdate - {hiredate} ELSE sysdate -
TRUNC(sysdate,'YEAR') END) - (TO_CHAR(sysdate,'IW') * 2))*
{custentity_vacay_time_cntr},'99.99')In this formula:
{hiredate}refers to the employee's hire date.sysdaterepresents the current system date.{custentity_vacay_time_cntr}is a custom entity field representing the vacation rate in percentage.- The
TO_CHAR(sysdate,'IW') * 2component provides an approximation for weekend days by counting the number of weeks.
When implementing vacation accrual calculations, it is crucial to consider HR best practices and local legislation. Typically, 'vacation due' refers to vacation accumulated in the previous year, which some companies allow employees to draw from. 'Vacation accrued' refers to vacation accumulated since the beginning of the current year, from which some companies may not permit drawing.
Expert NetSuite Support
Need help with this NetSuite issue?
Saved Searches & Formulas consulting and configuration support
