02-03-2022 10:01 AM
Does anyone have a pattern available to determine difference between two timestamps and add the duration to another timestamp, both of which calculations would exclude weekends?
For example, three inputs and one output:
Logic would find the time diff between 1 and 2, excluding weekends and add that time to 3, excluding weekends to land on target end timestamp.
For example, using reference range of last Friday 1/28 until Thursday 2/3 and target start of Friday 2/4. The 4 day difference would be calculated and added to 2/4 - excluding the coming weekend, result would be Thursday 2/10.
Thanks!
Adam
Solved! Go to Solution.
02-03-2022 01:09 PM
We can add some specific number of days to this calculation, which is basically a failsafe mechanism for picking up working days. Before it was just multiplying the difference, just to be sure, but adding, let’s say 4 days will help the logic to cover this edge cases.
Or we can complicate the second expression by adding more logic to it, again regarding the exclusion of the non working days.
I did some unit testing and it seems fine, but you can try more scenarios with both fixes and let me know if we need more updates.
02-03-2022 01:29 PM
This is excellent and seems to do exactly what I needed. Thank you very much!