Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to have Business Date ?

Hi guys,

How to have Business Date ?

As in if i apply Today()-1 and if there is Saturday or Sunday the report will be blank. So in this case if i run report on Monday Today()-1 should provide report of Friday.

Please help how to achieve the above.

Thanks.

6 Replies
NickHoff
Specialist
Specialist

Use the function NetworkDays()

Not applicable
Author

Can you give example for network days? I want holidays on Friday and Sunday.

alexandros17
Partner - Champion III
Partner - Champion III

It exists the function networkdays() ... maybe it can be useful ...

NickHoff
Specialist
Specialist

networkdays (start:date, end_date {, holiday})

Returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holidays. All parameters should be valid dates or timestamps.

Examples:

networkdays ('2007-02-19', '2007-03-01') returns 9

networkdays ('2006-12-18', '2006-12-31', '2006-12-25', '2006-12-26') returns 8

You also might be able to use:

firstworkdate(end_date, no_of_workdays {, holiday} )

Returns the latest starting date to achieve number_of_workdays (Monday-Friday) ending no later than end_date taking into account any optionally listed holidays. End_date and holiday should be valid dates or timestamps.

Examples:

firstworkdate ('2007-03-01', 9) returns '2007-02-19' 

firstworkdate ('2006-12-31', 8, '2006-12-25', '2006-12-26') returns '2006-12-18' 

lastworkdate(start_date, no_of_workdays {, holiday})

Returns the earliest ending date to achieve number_of_workdays (Monday-Friday) if starting at start_date taking into account any optionally listed holidays. Start_date and holiday should be valid dates or timestamps.

Examples:

lastworkdate ('2007-02-19', 9) returns '2007-03-01' 

lastworkdate ('2006-12-18', 8, '2006-12-25', '2006-12-26') returns '2006-12-29' 

Not applicable
Author

Thanks for reply.

If i want Friday and Saturday as working days and Sunday as Holiday. So how can i achieve ?

Not applicable
Author

If i want Friday and Saturday as holidays days and Sunday-Monday as Working days. So how can i achieve ?