Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Second & Fourth Monday of the Month?

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!

1 Solution

Accepted Solutions
MarcoWedel

Hi,

maybe one solution could be:

QlikCommunity_Thread_281517_Pic1.JPG

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

View solution in original post

1 Reply
MarcoWedel

Hi,

maybe one solution could be:

QlikCommunity_Thread_281517_Pic1.JPG

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