Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
C_Howarth
Contributor II
Contributor II

Find NetwokDays in current financial period

I am trying to write an expression to bring back the NetworkDays for the current financial period.

I have tried NetWorkDays(Floor(MonthStart(Today())), Floor(MonthEnd(Today())))

However this brings back the days for current calendar month

Thanks

1 Solution

Accepted Solutions
C_Howarth
Contributor II
Contributor II
Author

Many thanks for this. 1 slight change to get it to work:

 

NetWorkDays(Min({<mtd_flag = {1}>}date),
If(WeekDay(MonthEnd(Today()))='Sun',MonthEnd(today()),
If(WeekDay(MonthEnd(Today()))='Sat',Date(MonthEnd(Today())+1),
WeekEnd(MonthEnd(Today()),-1,0)))

 

Glad to have this one sorted

View solution in original post

7 Replies
iswarya
Partner - Creator
Partner - Creator

Try YearStart and YearEnd instead of MonthStart & MonthEnd.

 

NetworkDays(Floor(YearStart(Today())),Floor(YearEnd(Today())))

C_Howarth
Contributor II
Contributor II
Author

Unfortunately that will give network days for the year.

I need network days for the current financial period.

For example current month is September which starts on the 01/09/2019 how i need it to bring back the network days for period 9 which started on the 26/08/2019

iswarya
Partner - Creator
Partner - Creator

=NetWorkDays(Date(MonthStart(Today())-6,'DD-MM-YYYY'),Date(MonthEnd(Today()),'DD-MM-YYYY'))

StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

try to add weekstart:

NetWorkDays(Floor(WeekStart(MonthStart(Today()))), Floor(MonthEnd(Today())))

C_Howarth
Contributor II
Contributor II
Author

Thankyou both for your assistance with this. It has got me a bit closer:

 

NetWorkDays(WeekStart(MonthStart(Today()),0,0), WeekEnd(MonthEnd(Today()),-1,0))

 

This works for the current period however it will be incorrect if the last day of the period is the last or first day of a calendar month.

 

 

StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

try adding these condition:

NetWorkDays(WeekStart(MonthStart(Today()),0,0), If(WeekDay(MonthEnd(date))='Sun',MonthEnd(date),
If(WeekDay(MonthEnd(date))='Sat',Date(MonthEnd(date)+1),
WeekEnd(MonthEnd(date),-1,0)))))

C_Howarth
Contributor II
Contributor II
Author

Many thanks for this. 1 slight change to get it to work:

 

NetWorkDays(Min({<mtd_flag = {1}>}date),
If(WeekDay(MonthEnd(Today()))='Sun',MonthEnd(today()),
If(WeekDay(MonthEnd(Today()))='Sat',Date(MonthEnd(Today())+1),
WeekEnd(MonthEnd(Today()),-1,0)))

 

Glad to have this one sorted