3 Replies Latest reply on May 2, 2018 9:56 AM by Shinichiro Murakami

# Working Day Calculation- Don't want to include Saturday and Sunday

Hi All

I have one dimension (Next Ordering window) for which i want to show Date Range for eg. (1-6-2018 to 5-6-2018).

Calculation Logic:

Date range will be First 5 working days of next month. For eg Current Month is May. So the date range will be 1st June 2018 (Friday) to 7th June 2018(Thursday). By excluding Saturday (2nd June) and Sunday (3rd June). I need to display first 5 working days of month.

Calculation Name : Number_2nd_Line_6_30

Logic :

IF [Week_Day] = 'WD1-5' THEN STR(' ')

ELSE

(IF

MONTH(TODAY()) <12

THEN

'1'+"-"+str(MONTH(TODAY())+1)+"-"+str(YEAR(TODAY()))+" to "+'5'+"-"+str(MONTH(TODAY())+1)+"-"+str(YEAR(TODAY()))

ELSE

'1'+"-"+'1'+"-"+str(YEAR(TODAY())+1)+" to "+'5'+"-"+'1'+"-"+str(YEAR(TODAY())+1)

END)

END

For this i am getting 1-6-2018 to 5-6-2018 but this is incorrect as it includes saturday and sunday.

Thanks

PEACE (V)

• ###### 1. Re: Working Day Calculation- Don't want to include Saturday and Sunday

Hope I understand your request correctly.

Thanks,

Shin

• ###### 2. Re: Working Day Calculation- Don't want to include Saturday and Sunday

Hi Shinichiro

Thank you very much. You saved my Day.

Can you please explain me the calculation for date add field. And will this work if my current month is December.

Regards

Mahesh Rakwal

• ###### 3. Re: Working Day Calculation- Don't want to include Saturday and Sunday

Weekday

Sunday = 1  (up to Next Fri = +5 )

M = 2  (up to next Fri = +4 )

T = 3  (up to next Mon = +6)

W = 4 (up to next Tue = +6)

T = 5 (up to next Wed = +6)

F = 6 (up to next Thu = +6)

Sat = 7 (up to next Fri = +6)

Does not matter month/year, because this only use "weekday"

Thanks

Shin