Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there a way to programmatically determine the Second & Fourth Monday of the Month?
For example, if my dimension GOV_DECISION_BODY_SUB = ECG, I want to return the next second or fourth Monday of the month? Right now the easiest way I can think of is by a reference lookup table since that could easily be changed if a date falls on a holiday.
Thanks!
Hi,
maybe one solution could be:
tabDates:
LOAD *,
DayName(MonthStart(Date),Mod(7-WeekDay(MonthStart(Date)),7)+7) as SecondMonday,
DayName(MonthStart(Date),Mod(7-WeekDay(MonthStart(Date)),7)+21) as FourthMonday;
LOAD DayName(Today(),1-RecNo()) as Date
AutoGenerate 1000;
hope this helps
regards
Marco
Hi,
maybe one solution could be:
tabDates:
LOAD *,
DayName(MonthStart(Date),Mod(7-WeekDay(MonthStart(Date)),7)+7) as SecondMonday,
DayName(MonthStart(Date),Mod(7-WeekDay(MonthStart(Date)),7)+21) as FourthMonday;
LOAD DayName(Today(),1-RecNo()) as Date
AutoGenerate 1000;
hope this helps
regards
Marco