We're looking for a simple way to calculate the number of working weekdays. In Spotfire, there is no simple function, but in Tableau, there is a "Weekday"DateDiff("weekday",[ORDER DATE],[DELIVERY DATE])In Spotfire, the closest I got is this reference page, with an absurdly long statementhttp://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))
Hi all,
you can download the extension via exchange.ai
https://exchange.ai/downloads/datetimediff-calculation-method/
Thanks,
Michal
Listed formula gives integer value. We need something like DateDiff result. Also, if it is possible, feature like to define number of hours in a working day for different calculations. It makes analysis like support tickets / delivery on time easy. Thank you.
Hi Harold,
we (MIA Solutions) implemented an extension that allows you to calculate the datediff excluding weekends + with working time definition. This is method description:
**************************
DateTimeDiffWork
Calculates the working time difference between two datetime values
(Saturdays and Sundays are excluded).
Arg.1 = FromDateTime,
Arg.2 = ToDateTime,
Arg.3= FromWorkingTime,
Arg.4 = ToWorkingTime.
Example: DateTimeDiffWork(DateTime(2012,11,19,8,0,0,0),DateTime(2012,11,26,22,30,0,0),Time(9,0,0,0),Time(17,30,0,0))
Output: 2.3:0:0.000
**************************
If that is what you are searching for, contact me via michal.jakubik@miasolutions.sk - I will be happy to discuss more details with you.
Thanks,
Michal