Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
151562
Contributor II
Contributor II

Last working day of month

Hello.

I am trying to add a flag to my script where i want the last day of the month excluding holidays and weekend.

If the last day of the month is on suturday then i want friday to be my last day.

How do I do that without using monthend fuction?

Thank you,
FPS
Labels (1)
1 Solution

Accepted Solutions
vchuprina
Specialist
Specialist

Hi,

Try this:

https://help.qlik.com/en-US/sense/February2022/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTim...

firstworkdate(Monthend([Your Date Field]),1) AS Date

Also, you can add holidays as a third parameter, for instance for a current month I added 5/30/2022 and 5/31/2022 and as a result the last working day in May is 5/27/2022 - last Friday.

firstworkdate(Monthend(today()),1, '5/30/2022', '5/31/2022') AS Date

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").

View solution in original post

1 Reply
vchuprina
Specialist
Specialist

Hi,

Try this:

https://help.qlik.com/en-US/sense/February2022/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTim...

firstworkdate(Monthend([Your Date Field]),1) AS Date

Also, you can add holidays as a third parameter, for instance for a current month I added 5/30/2022 and 5/31/2022 and as a result the last working day in May is 5/27/2022 - last Friday.

firstworkdate(Monthend(today()),1, '5/30/2022', '5/31/2022') AS Date

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").