Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Last working day

Hi everyone.

I would like some help trying to create a variable for the last working date. It must also include public holidays which i already have in a spreadsheet.

I am trying to add a button in my application for LWD (Last Working Day) which when pressed the date selection changes to the last working date.

My fields are :

[Event Date]

PublicHols

I know there is a function NETWORKDAYS but i don't know where to start...

Any help would be appreciated.

Thanks

5 Replies
Gysbert_Wassenaar

The lastworkdate is probably the function you're looking for. It also excepts holidays are arguments. See the help file for details.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi thanks,

I dod't understand it though. how do i get the last working date?

the example gives..

lastworkdate ('2007-02-19', 9) which returns '2007-03-01' which is a date in the future...

so if i try

LastWorkDate(Today(),-1) i get null

or am i completely missunderstanding it?


swuehl
MVP
MVP

Even if this sounds non intuitive, I think you should look into FirstWorkDate() instead, like

=FirstWorkDate(today(),1)

add a comma separated list of holiday dates after the second argument.

Not applicable
Author

Hi, thansk that worked

how do i use a field name for my holiday dates?

I have loaded them in from an excel file and named the field 'PublicHols' but not sure how to include it

The help file says to use this format...

FirstWorkDate(end_date, no_of_workdays {, holiday} )

so i have tried

=FirstWorkDate('07/12/2012',2{, PublicHol})

but i get an error on the comma after the curly open bracket..

swuehl
MVP
MVP

{, ...} just means it's optional to the function call.

Here is a description on how to create and add your holiday values:

http://community.qlik.com/message/90025