Skip to main content

Hi, is there a way to add weekdays to a date?

E.g. Goods Issue date is on a Friday

and we need to add 2 weekdays (Monday through Friday are weekdays)

to the Goods Issue Date, so that we end at a Delivery Day of Tuesday (Friday + 2 weekdays)

ADD_DAYS would give us Sunday as output, and ADD_WORKDAYS only works with a workday calendar (needs TFACS table which we do not have)

REMAP_TIMESTAMP even with the ADD_DAYS function would bring us to Monday as the next weekday.

Hi EnowaVince,
I think this script will work:
CASE
WHEN DAY_OF_WEEK("BKPF"."BUDAT") IN (4, 5)
THEN ADD_DAYS("BKPF"."BUDAT", 4)
ELSE ADD_DAYS("BKPF"."BUDAT", 2)
END

The first row checks if the date in the column BUDAT is on a Thursday (4) or Friday (5). If so, the delivery day is then current date + 4, since two days of weekend are in between. If not, only two days are added. This result in a column with only weedays, as is depicted in the appendix.
Another option is to specify a workweek in the data model settings (tab Calendar) to use the ADD_WORKDAYS function, but this will also impact the throughput calculations.
Hope this works for you!
Bests,
Jan-peter

Hi Jan, thank you this worked! Very much appreciated.


Reply