Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get 2nd and 4 th Saturday for every month.

Hi All,

How to get 2nd and 4 th Saturday for every month.

1.In script

2.set expression

Regards,

Krishna

4 Replies
Gysbert_Wassenaar

LOAD

     Date,

     If(Day(Date)>=8 and Day(Date)<=15 and WeekDay(Date) = 5, 1,0) as IsSecondSaturday,

     If(Day(Date)>=22 and Day(Date)<=29 and WeekDay(Date) = 5, 1,0) as IsFourthSaturday,

...etc

Count({<Date={"=Day(Date)>=8 and Day(Date)<=15 and WeekDay(Date) = 5"}>}Date)

Count({<Date={"=Day(Date)>=22 and Day(Date)<=29 and WeekDay(Date) = 5"}>}Date)


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

Just a very minor correction, I think the upper inclusive limit should be 14 resp 28:

LOAD

     Date,

     If(Day(Date)>=8 and Day(Date)<=14 and WeekDay(Date) = 5, 1,0) as IsSecondSaturday,

     If(Day(Date)>=22 and Day(Date)<=28 and WeekDay(Date) = 5, 1,0) as IsFourthSaturday,

maxgro
MVP
MVP

see attachment

Gysbert_Wassenaar

Indeed. My bad. Thanks.


talk is cheap, supply exceeds demand