Ocean West Posted February 3 Share Posted February 3 Trying to calculate the estimated arrival date of a shipment. I believe I am overcomplicating it We ship same day before 3 pm otherwise, it ships on the next business day if it's Friday then Monday unless priority Saturday delivery is elected. Would like to make this more reliable. Grateful for a better approach. Let ( [ id = Method ; shipOn = Case( status = 0 ; Get(CurrentDate) ; INVOICES::Invoice_Date) ; w = DayOfWeek ( shipOn ) ; cutoff = Case ( Hour ( Get(CurrentHostTimestamp )) > 15 and w = 6 ; 2 ; 0 ) ]; shipOn + cutoff + Case ( //3Day id = 118 or id = 119; 3 + Case ( w ≥ 4 ; 2 ) ; //2Day id = 106 ; 2 + Case ( w ≥ 5 ; 2 ) ; //Std Overnight id = 116 ; 1 + Case ( w = 6 ; 1 ) ; //Priority id = 112 ; 1 + Case ( w = 6 ; 2 ) ; //SaturdayPriority id = 114 ; 1 ) ) Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now