Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mohamed_ahid
Partner - Specialist
Partner - Specialist

substact N working day from a date

Hi all,

I'm facing a probleme with date .Let me explain :

i want to get the date of today  minus 20 working day (dont count sunday and saturday)

exemple :

for october  13 2014 - 20 = september 16 2014

Thx

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

=FirstWorkDate(Date#('2013/10/13'), 20)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

7 Replies
anbu1984
Master III
Master III

Dt:

Load Date(Dt_Minus_20) Where DayDiff=20;

Load NetWorkDays(Dt-(20+IterNo()),Today()) As DayDiff,Today()-(20+IterNo()) As Dt_Minus_20 While IterNo() < 10 ;

Load

Today() As Dt

AUTOGENERATE(1);

mohamed_ahid
Partner - Specialist
Partner - Specialist
Author

thx but i didn't get your idea .

anbu1984
Master III
Master III

Generate a row with today's date

Load

Today() As Dt

AUTOGENERATE(1);

NetworkDays function return number of days between two dates without including weekends. Following statement generate 9 rows from Today()-20( 22-09-2014) to 14-09-2014

Load NetWorkDays(Dt-(20+IterNo()),Today()) As DayDiff,Today()-(20+IterNo()) As Dt_Minus_20 While IterNo() < 10 137573.png

Following statement picks date exactly 20 days from current day

Load Date(Dt_Minus_20) Where DayDiff=20;

mohamed_ahid
Partner - Specialist
Partner - Specialist
Author

is there a way to do that on designer rather than developer ?

anbu1984
Master III
Master III

Test this expr

=Date(If(NetWorkDays(Today()-26,Today()) = 20,Today()-26,If(NetWorkDays(Today()-27,Today()) = 20,Today()-27,If(NetWorkDays(Today()-28,Today()) = 20,Today()-28))))

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

=FirstWorkDate(Date#('2013/10/13'), 20)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
mohamed_ahid
Partner - Specialist
Partner - Specialist
Author

Thanx Anbu and Jonathan you were GREAT.