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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Last Work Date

Hi,

I have a variable vToday = Date(Today())

I would like to create a variable which shows the last business day date, based on the above variable.

I thought this could be achieved by the following; vLastWorkDay = LastWorkDate(vToday,-1).  However this doesn't return any values.

Any help would be much appreciated.

Regards,

Daniel

Labels (1)
2 Replies
Anonymous
Not applicable

Hi Daniel,

The function LastWorkDate(StartDate, NumberOfDays) returns the last date of a time period starting on the StartDate, and containing NumberOfDays working days (weekends excluded).

It is not clear what you're tying to find.  Start date can be today, but the number of working days must be positive.  For example you allocate 30 working days for a task, and start day is today, you can find the last business date for that task:

LastWorkDate(today(),30).

Regards,

Michael

MK_QSL
MVP
MVP

Considering you have working days as Monday to Friday... you can get last work date as below

=IF(NUM(WeekDay(Today()))=0,Date(Today()-3),Date(Today()-1))