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: 
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
swuehl
MVP
MVP

Try

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

or

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


View solution in original post

6 Replies
m_woolf
Master II
Master II

Look at networkdays in help

Not applicable
Author

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

m_woolf
Master II
Master II

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

swuehl
MVP
MVP

Try

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

or

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


Not applicable
Author

Thanks very much, this is exactly what I need.

Not applicable
Author

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