Skip navigation

Better DateDiff functionality: weekends/holidays attributes

score 0
You have not voted. Duplicate

Having the ability to filter out holidays and weekends within the datediff function would be a huge deal. Right now workarounds take several calculated fields and lots of extra steps.

 

Something like this would be awesome and possibly more resource efficient as well.

 

DATEDIFF( date_part, start_date, end_start, [Start of Week], [Weekend Exclusion], [Country Code Public Holidays])

 

Weekend Exclusion options: "Weekend" (Only Weekends), "Weekday" (Only Weekdays), "All" (If Public Holidays will be set, otherwise empty)

Public Holidays: "US" (US Federal Holidays), "UK" etc..., [Custom List] (Enter list of days, useful for corporate holidays observed)

 

Example:

 

DATEDIFF( 'day', [Start Date], [End Date], 1, "All", "US")

 

This would make things much easier to maintain and troubleshoot if it was a standard feature in Tableau, rather than having to write it out ourselves.

Comments

Vote history