Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
delbooth
Contributor II
Contributor II

Working days and filter

Hi.

I am trying to use the networkdays function to get the number of days in a month.  I have a filter called SchMonth that lists the months as Jan, Feb etc.  I have tried using the expression below to get the number of days when a month is selected in the filter SchMonth but it does not give the number of days for the month ie selecting Feb in SchMonth does not give the correct number of working days ie 20

=NetWorkDays(MonthStart(SchMonth),MonthEnd(SchMonth))

Thanks

4 Replies
timpoismans
Specialist
Specialist

MonthStart and MonthEnd require an actual date as input, not just a month.

In case you got a Date-field as well, you can try using that.

If you don't, and you have a Year-field, try the following:

=networkdays( monthstart(makedate(Year, Month)), monthend(makedate(Year, Month)) )

WorkDays.PNG

delbooth
Contributor II
Contributor II
Author

Thanks

timpoismans
Specialist
Specialist

You're welcome.

If you managed to resolve your question, mark it as such, even if it's your own answer.

So no resolved questions stay lingering around with an unresolved marker on them.

Thanks!

Regards,

Tim P.

DavidŠtorek
Creator III
Creator III

Hi,

you can check how to use function here https://help.qlik.com/en-US/sense/September2018/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTi...

Does your field SchMonth has number format or is it just text (did you get month name by using Month() function)? The other thing is that you not define holidays dates.