Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous Business Day excluding holidays?

Finding logic to show last working week day for week over week comparison and similarly finding last working day for month over month comparison?

find previous business day(Working day), excluding holiday, and if the week end is a public holiday then it should get next previous available date.

If i am processing Monday, I should get Friday as working day, if Friday is holiday then I should get Thursday as working day.

Right now, I am using count({$(vsetcurrentweek)>}Fl_Volume_Flag) which is all about current week.

Any help???

Thank you

4 Replies
Anonymous
Not applicable
Author

You can use firstworkdate.

From QV help:


Firstworkdate(end_date, no_of_workdays {, holiday} )

Returns the latest starting date to achieve number_of_workdays (Monday-Friday) ending no later than end_date taking into account any optionally listed holidays. End_date and holiday should be valid dates or timestamps.

Examples:

firstworkdate ('2007-03-01', 9) returns '2007-02-19' 

firstworkdate ('2006-12-31', 8, '2006-12-25', '2006-12-26') returns '2006-12-18' 

Not applicable
Author

Thank you

robert_mika
Master III
Master III

You are welcome.

Please mark this question as answered