Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
MVP & Luminary
MVP & Luminary

Re: Last working day

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

Re: Last working day

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?


MVP
MVP

Re: Last working day

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

Re: Last working day

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..

MVP
MVP

Re: Last working day

{, ...} 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