Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
A7R3
Contributor III
Contributor III

Last Friday of the Month

Hi,

I am doing the data comparison from Today() data to the previous month's data in weekly reporting. To ensure the consistent comparison, I would like to compare the current data to the data from the last Friday of the previous month.

How do I pick the last Friday of the previous month from Today()?

For example, in 2021,

if Today() is Mar 26, the last Friday of the previous month would be Feb 26.

if Today() is Apr 5, the last Friday of the previous month would be March 26.

if Today() is May 20, the last Friday of the previous month would be Apr 30.

Any pointer is appreciated. Thank you in advance.

 

Labels (2)
1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

I find it helpful to work out solutions 1 step at a time.

Untitled.png

=Date(MonthStart(Today(1)) - 1 - Match(WeekDay(MonthStart(Today(1)) - 1),'Sat','Sun','Mon','Tue','Wed','Thu'),'M/D/YYYY')

 

View solution in original post

2 Replies
jwjackso
Specialist III
Specialist III

I find it helpful to work out solutions 1 step at a time.

Untitled.png

=Date(MonthStart(Today(1)) - 1 - Match(WeekDay(MonthStart(Today(1)) - 1),'Sat','Sun','Mon','Tue','Wed','Thu'),'M/D/YYYY')

 

A7R3
Contributor III
Contributor III
Author

Thank you so much. It works wonderfully.

Appreciate the steps to work it out. It is going to be very useful to debug complex set analysis.