Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
PRS
Creator
Creator

Display Weekend dates in each month of year

Hi Techies,

Wish you a happy new year to all.

I am trying to display all weekend dates(Sunday dates) of each month in a year using below expression.

=Date(WeekEnd(Date#(Date,'YYYYMMDD')),'DD/MM/YYYY')​.


But when i select any particular month from the filter then it is showing all the Sunday dates along with 1st Sunday date of next month which is not correct.


I need create this weekend dates filed and i have to add it in pivot table to display display actual and planned rates in weekends of each month


I have attached the screen shots of selections for your reference.


Please correct me if did any wrong in expression


Thanks in Advance.


Regards,

Rajasekhar

1 Solution

Accepted Solutions
HirisH_V7
Master
Master

Hi,

Try this,

=IF(Month(Weekend(WeekName(Date)))=Month(Date),Date(Weekend(WeekName(Date))+1,'DD/MM/YYYY'))

HTH,

Hirish

HirisH

View solution in original post

4 Replies
MK_QSL
MVP
MVP

Try this expression...

=IF(Num(WeekDay(Date))=6,Date(Date#(Date,'YYYYMMDD'),'DD/MM/YYYY'))

HirisH_V7
Master
Master

Hi,

Try this,

=IF(Month(Weekend(WeekName(Date)))=Month(Date),Date(Weekend(WeekName(Date))+1,'DD/MM/YYYY'))

HTH,

Hirish

HirisH
robert99
Specialist III
Specialist III

weekday (Date) as DaySunEtc,  // gives day of week ie Sun, Mon etc

weekend (Date) as DatesWESun ,   // date week ends Sunday

I think if you filter by Sun (DaySunEtc) and the appropriate year and month it should give you the correct dates

PRS
Creator
Creator
Author

Thanks Hirish,

Its worked for me. I modified your expression like below

IF(Month(Weekend(WeekName(Date#(GLDate,'YYYYMMDD'))))=Month(Date#(GLDate,'YYYYMMDD')),Date(Weekend(WeekName(Date#(GLDate,'YYYYMMDD'))),'DD/MM/YYYY')).

Thanks & Regards,

Rajasekhar