Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rcandeo
Creator III
Creator III

How can I find out the number of days?

Hi, I need to find out how many billing days are there in a selection. For this I need to find out how many normal days are there in the selection and How many saturdays are there in the same selection.

I Have in my application two fields used for selection: Year and Month.

----------------------------------

If the user select Year = 2012 and Month = 01. I need to find out the following result

22 normal days

4 saturdays

My total would be 24 billing days (saturday conts like a half normal day)

--------------------------------------

Suppose that january 30 was a holliday, my result should be

21 normal days

4 saturdays

My total would be 23 billing days

--------------------------------------

If the user select Year = 2012 and Month = 02 and today is february, 15. I need to find out the following result

10 normal days (1,2, 3, 6, 7, 8, 9, 10, 13, 14) (Today does not count since it is not an online application and I don't have today's data)

2 saturdays

My total would be 11 billing days (remember that saturday conts like a half normal day)

-------------------------------------

If the user select Year = 2012 and Month = 01 and 02 and today is february, 15. I need to find out the following result

31 normal days

6 saturdays

My total would be 34 billing days

--------------------------------------

I suppose that nobody has a magical formula to help me and without this magical information I guess I need to create a table with the holidays information.

My questions:

How can I find out the number of days in the selection?

How can I find out the number of saturdays and sundays in the selection?

Best Regards

Robson

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Hi Robson,

Have a look at NETWORKDAYS function, it would help you out.

Regards,  tresesco

View solution in original post

3 Replies
tresesco
MVP
MVP

Hi Robson,

Have a look at NETWORKDAYS function, it would help you out.

Regards,  tresesco

Not applicable

Have you tried the networkdays function. This could be used to return the normal days(work days).


tresesco
MVP
MVP

anyway, you would have list of holidays which you have to use in the function as third argument. if you get more than 6 working days, that says that there must be one Sunday and one Saturday in between. now finding the Day of starting date you can find exact number of saturdays between those two days. i.e. with networkdays function a bit of trick would be required.

Hope this helps.

regards,  tresesco