SLA Due Date That Skips Weekends and Holidays
A case must be answered within a number of working days. Given ri!startDate, ri!businessDays (1 or more) and ri!holidays (a list of dates, possibly empty), return the due date.
- The start date itself is not counted: the first working day after it is day 1.
- Saturdays, Sundays and any date in
ri!holidaysare not working days.
The calendar functions that do this for you are banned here: workday(), networkdays(), calworkdays(), calisworkday() and caladddays(). Build it from weekday() and list functions.
Why it comes up: in a real app, workday(ri!startDate, ri!businessDays, ri!holidays) does this in one call. Building it yourself practises a pattern you need often in Appian, which has no while loop: list more dates than you need, filter out the ones that don't count, and take the Nth.
Restrictions
Solve this without using workday(), networkdays(), calworkdays(), calisworkday() or caladddays().
ri! Rule Inputs
ri!startDateDatedate(2026, 11, 16)
ri!businessDaysInteger3
ri!holidaysList of Date{}Example 1: Monday plus three days
date(2026, 11, 16)
3
{}date(2026, 11, 19)
Example 2: Friday rolls over the weekend
date(2026, 11, 20)
1
{}date(2026, 11, 23)
Example 3: Two holidays then a weekend
date(2026, 11, 25)
2
{
date(2026, 11, 26),
date(2026, 11, 27)
}date(2026, 12, 1)
Example 4: Starting on a Saturday
date(2026, 11, 21)
5
{}date(2026, 11, 27)
Example 5: Holidays on both sides of a weekend
date(2026, 12, 24)
3
{
date(2026, 12, 25),
date(2026, 12, 28)
}date(2026, 12, 31)
Appian Expression Tips
- • Use
ri!variableNamefor rule inputs - • Use
a!localVariables(local!x: …, body)for locals - • Use
a!forEach(items: …, expression: fv!item)to iterate - • Use
where()/reject(fn!isnull, list)to filter