Skip to Main Content
Spotfire Ideas Portal
Status Future Consideration
Product Spotfire
Categories Custom Expressions
Created by Guest
Created on Feb 6, 2016
Merged idea
This idea has been merged into another idea. To comment or vote on this idea, please visit SPF-I-2637 Working Days function.

Function to calculate the number of working weekdays Merged

Looking for a simple way to calculate the number of working weekdays. 


DateDiff("weekday",[ORDER DATE],[DELIVERY DATE]) In Spotfire, the closest I got is this reference page, with an absurdly long statement
http://tibcoanalytics.com/spotfire/archive/totw/2010-01-23.html
((((Integer(((Integer(DateDiff("day",[ORDER DATE],[DELIVERY DATE]) / 7) * 5) + DayOfWeek([DELIVERY DATE])) - DayOfWeek([ORDER DATE])) + (if((integer(DayOfWeek([ORDER DATE])))>(integer(DayOfWeek([DELIVERY DATE]))),5,0))) - (if((integer(DayOfWeek([DELIVERY DATE])))=(6),1,0))) + (if((integer(DayOfWeek([DELIVERY DATE])))<>(0),1,0))) + (if((integer(DayOfWeek([DELIVERY DATE])))=(0),1,0))) - (if((integer(DayOfWeek([ORDER DATE])))=(0),1,0))