Hello,
In a workflow for order planning, I calculate a production date from a delivery date (received by the customer) via Date & Time Shift Node: Manufacturing date = delivery date - 3 days.
Saturdays and Sundays are also included, which I would like to exclude (no working days).
Example:
Delivery date = 22.06.2021
Manufacturing date = 22.06. - 3 days = 19.06.2021 (Saturday)
The next day of the week would then have to be set via a condition, in this example it would be 06/18/2021 (Friday).
I’ve whipped something up real quick and I hope it gets close to what you are aiming at. Workflow attached, here’s what I’ve done:
Created dates as provisionary manufacturing dates, named the column “date”
Appended column with manufacturing date shifted +3d, named it “date_delivery”
Extracted day of week of “date_delivery”
Rule Engine: if day of week = 6 => -1, if day of week = 7 => -2, else 0
Shifted “date” by number of days from Rule Engine. Saturdays and Sundays become the previous Friday, named this new column “date_manufacturing”
The last two nodes are optional. If you don’t have any deliveries on Sunday, you could exclude the 7s from the day of week column before the Rule Engine. I only noticed afterwards and couldn’t be bothered to change the order of nodes again. I think you get the idea. The resulting table could then be joined with the table containing the dates you use.