Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Count of Calendar Days minus Weekends

Hi,

I am working with some statistical data that is tagged with a data date (this is the date we collected the data). I have created a master calendar to ensure that I see all days during a month rather than just the days we have data for.

I am now trying to do a few calculations. Firstly I did a count of the days we have data which works fine

 

COUNT

(DISTINCT{$<dayused = {">=$(vMinCalDate)<=$(vMaxCalDate) "}>} dayused

Then I calculated the Calendar Days during that period

Count(DISTINCT Date)

Again this worked fine. But I am unable to calculate the Calendar days minus weekends

count({$<NUM(Weekday)={0,1,2,3,4} >}Date)

I have a Weekday field that was created as part of my master calendar and I have tested IF statements that show that 0 = Mon, 1 = Tues etc, but this expression is not accepted.

Can anyone suggest what is requird?

Regards

Steve

1 Solution

Accepted Solutions
MVP
MVP

Re: Count of Calendar Days minus Weekends

Try

count({$<Weekday = {0,1,2,3,4} >} DISTINCT Date)

or

count({$<Weekday -= {'Sat','Sun'} >} DISTINCT Date)


6 Replies
mwoolf
Honored Contributor II

Re: Count of Calendar Days minus Weekends

Look at networkdays in help

Not applicable

Re: Count of Calendar Days minus Weekends

I checked out NETWORKDAYS and tried various combinations and I could not make it work unfortunately.

mwoolf
Honored Contributor II

Re: Count of Calendar Days minus Weekends

=networkdays($(vMinCalDate),$(vMaxCalDate))

MVP
MVP

Re: Count of Calendar Days minus Weekends

Try

count({$<Weekday = {0,1,2,3,4} >} DISTINCT Date)

or

count({$<Weekday -= {'Sat','Sun'} >} DISTINCT Date)


Not applicable

Re: Count of Calendar Days minus Weekends

Thanks very much, this is exactly what I need.

Not applicable

Re: Count of Calendar Days minus Weekends

Hi Swuehl!

i was reading this post with much interest.

i have the case whereby i seek the amount of network days between two dates. in this case both are variables.

i have tried with the following without sucess -> count(Networkdays($(EndDate, $(StartDate))

any ideas?

Best Brad

Community Browser