Page 1 of 1

How to identify first Monday of the month

Posted: Wed Aug 23, 2017 9:52 am
by wilsonburazon
Is there any way in a transformer stage or any stage to know the specific day of a month? How do you know if the input is the first Monday of the month.

Posted: Wed Aug 23, 2017 10:04 am
by UCDI
what about

NextWeekdayFromDate
or
NthWeekdayFromDate

Posted: Wed Aug 23, 2017 10:30 am
by qt_ky
For first Monday of the month, try using WeekdayFromDate() to check if it is Monday along with checking if the day number of the month is <= 7.

Posted: Wed Aug 23, 2017 11:37 am
by wilsonburazon
What if I have input records:
2017-08-04
2017-08-14
2017-08-21
2017-08-28

If I use WeekdayFromDate, all these records will return 1 (Monday). My goal is to find only the 2017-08-04.

Thanks for the reply tho.

Posted: Wed Aug 23, 2017 11:56 am
by UCDI
that is why he said weekday <= 7 or <8 if you prefer.

14,21, and 28 fail this conditional.

Posted: Wed Aug 23, 2017 12:01 pm
by wilsonburazon
Cool. Got it! Thanks! :)