Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Date Difference Excluding weekends


Hi all

I want to be able to see how many working days are letf in a month, for example what I have below is;

But I want to remove the count for the weekend days or even just Sunday if possible.

Any ideas?

I want this as a caculated dimension in a pivot chart. 

=MONTH_END-today()

Thanks

Aidan

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Date Difference Excluding weekends

=CEIL(Interval(MonthEnd(Today())-Today(),'dd') -  Div(MonthEnd(Today())-Today(),7) + (weekday(Today()) > WeekDay(MonthEnd(Today()))))

12 Replies
MVP
MVP

Re: Date Difference Excluding weekends

Including Weekends.

=Interval(MonthEnd(Today())-Today(),'dd')

Excluding Weekends.

=NetWorkDays(Today(),MonthEnd(Today()))

anbu1984
Honored Contributor III

Re: Date Difference Excluding weekends

=NetWorkDays(today(), Month_End)

Not applicable

Re: Date Difference Excluding weekends

Thansk you this seems to have worked for me, is their anyway I can discount any day that is Sunday on this?

Thanks again,

Aidan

MVP & Luminary
MVP & Luminary

Re: Date Difference Excluding weekends

Unfortunately networkdays included no possibility for saturday or sunday. If you needs this you need a more complex expression which additionally counted these day. Easier will be to use a special field within the master-calendar like:

if(num(weekday(date)) = 6, 0 ,1) as working_day

and the use a simply sum(working_day) within your chart.

- Marcus

sebastiandperei
Valued Contributor

Re: Date Difference Excluding weekends

What you mean that you need as calculated dimention?

You want to see like one row by every "non sunday" day? What you have in MONTH_END field?

Not applicable

Re: Date Difference Excluding weekends

  So the below is what I have but I want this to only exclude Sunday and include Saturday

Excluding Weekends.

=NetWorkDays(Today(),MonthEnd(Today()))

MVP
MVP

Re: Date Difference Excluding weekends

What is meant by Discount Sunday?

Please elaborate little more on this !

Not applicable

Re: Date Difference Excluding weekends

So I want to know how many working days are left in the month, so today being the 16th, we have 13 work days left including today but excluding the last 2 Sundays of the month.


MVP
MVP

Re: Date Difference Excluding weekends

=CEIL(Interval(MonthEnd(Today())-Today(),'dd') -  Div(MonthEnd(Today())-Today(),7) + (weekday(Today()) > WeekDay(MonthEnd(Today()))))

Community Browser