workDays()

The workDays() function returns the number of weekdays (i.e., Monday through Friday) between two dates.

Syntax

workDays(date1, date2, [holidays])

Argument Description
date1

(required)

An expression that results in a date value (i.e., a hard-coded date, a reference to a date attribute, or a function that returns a date value).
date2

(required)

An expression that results in a date value (i.e., a hard-coded date, a reference to a date attribute, or a function that returns a date value).

This date will be subtracted from the first date argument to produce the result of the function.

Note: if either argument in this function resolves to <empty>, the returned value will be <empty>.

holidays

(optional)

An expression that results in a comma separated list of date values (i.e., hard-coded dates or a reference to an attribute). These dates will be ignored, along with weekends, when counting work days.

Note: If the holidays argument is hard-coded, it should be surrounded in quotation marks (e.g., “2020-12-25, 2021-01-01”).

Where Available

Available in all places the injected expression icon is visible, as well as within Filter fields on Cards, Tables and List/View sections.

Examples

Where Example(s)
Business rules: Set Value

Attribute expression

workDays("2023-12-10", "2023-12-01")  result: 6

workDays("2023-12-01", "2023-12-10")  result: -6

workDays("2023-01-08", "2023-12-20", Holidays__c)

workDays("2024-01-08", "2023-12-20", “2023-12-25, 2024-01-01”)  result: 12

workDays(Stage_2_Start__c, Stage_1_Start__c)

workDays(dueDate, today())

Field Editability expression

Tab Visibility expression

Business rules: Condition

LOE_Estimate__c < workDays (Stage_2_Start__c, Stage_1_Start__c)
Business rules: Notification Subject

Business rules: Notification Body

Dynamic Filter

{!workDays(Stage_2_Start__c, Stage_1_Start__c, Holidays__c)}

{!workDays(due_date__c, today())}

 

 

Embedded Section URL attribute

Business Rule: URL Call

External View URL on List/View

{!URL1__c & “/” & workDays(due_date__c, today())}
Metric expression sumif(Initiative__t, OPEX__m, active and LOE_Estimate__c < workDays(Stage_2_Start__c, Stage_1_Start__c))

 

 

Updated on January 29, 2024

Related Articles