Qlik Community

Qlik Sense Deployment & Management

Discussion board where members learn more about Qlik Sense Installation, Deployment and Management.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Last sunday of month

Hai all, I try to make a flag for the last sunday of the month

=If(Date([DatFieldName], 'DD-MM-YYYY' )=Date(WeekEnd(MonthEnd(date#([DatFieldName],'DD-MM-YYYY'),)),'DD/MM/YYYY'),1,0) as FlagLastSunday            =>   does not work

it works for WeekStart  = but I need the sunday not the monday

=If(Date([Datum], 'DD-MM-YYYY' )=Date(WeekStart(MonthEnd(date#([Datum],'DD-MM-YYYY'),0)),'DD-MM-YYYY'),1)

Anyone?

Regards,
Ronald

1 Solution

Accepted Solutions
Highlighted

May be this

 

If([DatFieldName] = Floor(WeekEnd(MonthEnd([DatFieldName])-6, 0, 0)), 1, 0) as FlagLastSunday;

 

 

View solution in original post

3 Replies
Highlighted

May be this

 

If([DatFieldName] = Floor(WeekEnd(MonthEnd([DatFieldName])-6, 0, 0)), 1, 0) as FlagLastSunday;

 

 

View solution in original post

Highlighted
MVP
MVP

The logic could be something like:

If(Day(MonthEnd(Date))-Day(Date)<=7 and Num(WeekDay(Date))=0, 1,0) as LastSUNFlag

 

Highlighted
Contributor
Contributor

Thanx Sunny!!!