Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
abc_18
Creator II
Creator II

How to get number of days in a year, quarter and month

Hi,

Can someone please help me in the below metrices calculation:-

here fiscal year starts from OCT

Metrices                                                           Description

Total Work Days in Month           Total number for this current month

Work Days Elapsed Month           Number of working days that have been completed (so for todays reporting it would be 1)

Total Work Days in Quarter         Total number for this current quarter

Work Days Elapsed Qtr                  Number of working days that have been completed (so all of Julys work days and then yesterday)

Total Work Days in Year                Total number for this current Year

Work Days Elapsed Year                Number of working days that have been completed (so all workdays from October to July and then yesterday)

1 Solution

Accepted Solutions
micheledenardi
Specialist II
Specialist II

ok so:

networkdays(yearstart(today(1)-1,0,10),today(1)-1) as [Work Days Elapsed Year]

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

6 Replies
micheledenardi
Specialist II
Specialist II

To create these flags you need to use NetWorkDays() function which allow you to specify custom festivity of your  company/country.

 

 

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
abc_18
Creator II
Creator II
Author

Hi,

By using NetWorkDays, I am able to acheive Total Work Days in Month , quarter and year, like below:-

NetWorkDays(MonthStart(Max(skey_date)), MonthEnd(Max(skey_date))) give me Total Work Days in Month           

But how to acheive  

Work Days Elapsed Month           Number of working days that have been completed (so for todays reporting it would be 2)

Work Days Elapsed Qtr                  Number of working days that have been completed (so all of Julys work days and then yesterday)

Work Days Elapsed Year                Number of working days that have been completed (so all workdays from October to July and then yesterday)

micheledenardi
Specialist II
Specialist II

Load 

NetWorkDays(MonthStart(today(1)-1), today(1)-1) as [Work Days Elapsed Month],

NetWorkDays(yearstart(today(1)-1,0,7), today(1)-1) as [Work Days Elapsed Qtr]

Resident Calendar;

Not clear what "Work Days Elapsed Year" must contains.... working days between oct and july ? or from oct. to yesterday ?

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
abc_18
Creator II
Creator II
Author

We have finacial year starting from 'OCT', so Work Days Elapsed Year  should show number of working days that have been completed (so all workdays from October  2018 to Aug 2019 till yesterday)

micheledenardi
Specialist II
Specialist II

ok so:

networkdays(yearstart(today(1)-1,0,10),today(1)-1) as [Work Days Elapsed Year]

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
abc_18
Creator II
Creator II
Author

Thanks