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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

firstworkdate()

FirstWorkDate(Today(), 1, ’04-Jul-2014′)

Note: Today is 6th July 2014.

This function returns 03-Jul-2014 because 06-Jul-2014 is Sunday, 05-Jul-2014 is Saturday and 04-Jul-2014 is a holiday

if it is 2015 on the same date how can i go back to application and edit 2015 instead of 2014??

is there any solution to write with out years??

4 Replies
Anonymous
Not applicable
Author

What are you trying to solve with this? Do you only want to use this specific date? Is there a range of years you'd like to use? There are a few ways to accomplish what you're looking to do, but more details are needed.

Anonymous
Not applicable
Author

actually i want to display previous day data like Monday to Friday avoid Saturday and Sunday

->for above requirement i already wrote a expression by using Firstworkdate()

but now i want to avoid holidays also !!!

Not applicable
Author

Refer this post:Calculating Holidays in script

Hope this helps.

Anonymous
Not applicable
Author

You can also go out and scrape government websites too to get a list, depending on your location as well, to get a list of holidays. The put them into a variable and use the variable in your calculation.

firstworkdate(Today(), 1, $(vHolidays))

I've attached an example for getting the data.