I am attempting to calculate late orders from vendors using a report. We want to give 1 day of leeway late and IDEALLY skip weekends and Holidays. From there we want to calculate their on time delivery percentage. Maybe there is a different way to do this, but I am trying to use DateDiff.
- Today I am using this formula to determine if it is late or not:
If DateDiff ("d", {V_PO_LINES.ORIG_DUE_DATE}, {V_PO_LINES.DATE_LAST_RECEIVED}) > 1 Then 0 else 1
I don't care if it is early, but if it is late it creates production issues. So we give 1 day of leeway. The issue is using date diff, I can only see the number of days difference. If the Due Date is Friday and we don't get it until Monday, that would be technically within our 1 day of leeway. Or if today is Wednesday and we have Thursday as a Holiday, I wouldn't want to count it.
- From there I am calculating an on time delivery percentage:
Sum ({@Date_Compare}, {V_PO_LINES.VENDOR}) / Count ({@Date_Compare}, {V_PO_LINES.VENDOR}) * 100
I would think we should be able to get the 1 day / weekend thing captured but Holidays is another beast entirely. We would probably even be happy manually allowing for Holidays. There is no mechanism in the system that says what dates are holidays.