Parameter has to be a Date type.
On Thu, Mar 12, 2015 at 2:41 PM, Alex Welch <
Using 2015-02-1 as an example you would get 2015-02-11 which is only 8 work days (10 calendar days). The end result I am looking for is 2015-02-13 which is 5 'work days' (Monday, Tuesday, Wednesday, Thursday, and Friday inclusive)
On Thu, Mar 12, 2015 at 2:59 PM, Alex Welch <
Thank you for your help but that doesn't solve the underlying problem. It needs to be scalable. The above date situation was just an example. Imagine that the user could expand the scope from 10 to 20. Or that instead of starting on a Sunday (as 2015-02-01 is) that it started on 2015-02-04. In that case it spans over 2 weekends.
In each of those events simply adding 'days' will produce incorrect results.
Starting on weekend +12, else +14.
if Date('weekday',[Parameter])=1 or Date('weekday',[Parameter])=7 then 12
else 14 end,
On Thu, Mar 12, 2015 at 3:11 PM, Alex Welch <
Again, what if it spans multiple weekends. Hard coding the number of days doesn't seem to be the way to go. I need it to be scale able over months.
Just divide the datediff() by 7. One can make the numbers dynamic according
to the number of weeks in between.
On Fri, Mar 13, 2015 at 6:32 AM, Alex Welch <
Would you be able to provide a workbook with a working example of this? I seem to be failing grasping what you are saying.
Here comes the workbook | Tableau Public
Given the [Scope] of work days, calculate the [Date Difference]. Then add the difference to Start Date. You get the [End Date].
The formula is as follows:
if DATEPART('weekday',[Start Date])=3 then iif([Scope%5] =4,2,0)
elseif DATEPART('weekday',[Start Date])=4 then iif([Scope%5]>=3,2,0)
elseif DATEPART('weekday',[Start Date])=5 then iif([Scope%5]>=2,2,0)
elseif DATEPART('weekday',[Start Date])=6 then iif([Scope%5]>=1,2,0)
elseif DATEPART('weekday',[Start Date])=7 then 1
Does this solve your problem?