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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Find first workdate

What is the easiest way to identify the first workdate (Mon-fri) for each month?

1 Solution

Accepted Solutions
disqr_rm
Partner - Specialist III
Partner - Specialist III

I haven't tried this function myself. Will check.

In the meantime you may calculate it yourself in the code:

LOAD Monthname, date(min(Date)) as FirstWorkDate group by Monthname;
LOAD *, monthname(Date) as Monthname
where weekday(Date) < 5;
LOAD today()-recno() as Date autogenerate 365;

View solution in original post

6 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

Try function firstworkdate. Syntax is: firstworkdate( end_date, no_of_workdays {, holiday} )

Thanks

Not applicable
Author

But that will slide over to the previous month sometimes and return e.g the last day of the previous month? How do I define no_of_workdays in a good way?

Thanks!

wizardo
Creator III
Creator III

i think :

Today() - MonthStart(Today()) should do the trick

Mansyno

disqr_rm
Partner - Specialist III
Partner - Specialist III

I haven't tried this function myself. Will check.

In the meantime you may calculate it yourself in the code:

LOAD Monthname, date(min(Date)) as FirstWorkDate group by Monthname;
LOAD *, monthname(Date) as Monthname
where weekday(Date) < 5;
LOAD today()-recno() as Date autogenerate 365;

Not applicable
Author

But that will result in a date from a previous month?

=



firstworkdate('2009-04-10',Today() - MonthStart(Today()))

returns 3/11/2009 for example.

Not applicable
Author

Yes I will do it in the load script instead. Thank you very much!