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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Saif1
Partner - Creator
Partner - Creator

A column to give the number of the working day corresponding to date

Hello Qlikers ,

i want to know how to know if a day is the nth working day in the month ?

example :

Date                      Work day number in the month

10/3/2022             1

10/4/2022             2


10/5/2022             3

10/6/2022             4

10/9/2022              5


how to achieve this? I want it because i need to make calculations on the 11th working day of the month.



Also, Can I reload the data in the task schedular on the 11th working day ? is it possible ?

thanks

Labels (1)
1 Solution

Accepted Solutions
Saif1
Partner - Creator
Partner - Creator
Author

what worked was that i used networkingdays(endmonth(date),endmonth(nextmonth(date)))-13 to give me the 11th day and the length was networkingdays(Date,monthend(date) and add them togather to give me the length(business days)

View solution in original post

5 Replies
pcv_devo
Partner - Contributor III
Partner - Contributor III

Hi @Saif1,

There is a function that can help you with your business days problem: networkdays .

To recharge on the 11th we have many options. An easy way is to schedule a daily reload task and limit your code to this function having the value 11 with an IF conditional.

Saif1
Partner - Creator
Partner - Creator
Author

Hello @pcv_devo , 

sorry for the late reply,

my case is to do some calculations when we reach the 11th working day of a certain month , the 11th working day varies in every month, this is why i need to find it , not the 11 working days between current date and a certain date, i just want to know if ; ex: (5th of October 2022) - today's date- for example, what working day is it ? and the answer for this since  the 1st of October was Saturday and the 2nd was Sunday , then the first working day is the 3'rd of October and the second is 4th etc etc , what is the calculation to calculate (let us say, the 24th november 2022) ?? can't do it manually need a caclulation for it.

Saif1
Partner - Creator
Partner - Creator
Author

any solution yet?? found this on excel =WORKDAY(DATE(A1,B1,1)-1,5)  , any help in qlik??

sidhiq91
Specialist II
Specialist II

@Saif1  Could you please try the below mentioned code and let me know if it has worked.

NoConcatenate
Temp:
Load Date(Date#(Date,'MM/DD/YYYY'),'MM/DD/YYYY') as Date
Inline [
Date
10/1/2022
10/2/2022
10/3/2022
10/4/2022
10/5/2022
10/6/2022
10/7/2022
10/8/2022
10/9/2022
10/10/2022
10/11/2022
];

NoConcatenate
Temp1:
Load *,
weekday(Date) as Day_Name
Resident Temp;

NoConcatenate
Temp2:
Load *,
Rowno() as Day_number
Resident Temp1
where not match(Day_Name,'Saturday','Sunday');

Drop table Temp, Temp1;

Exit Script;

sidhiq91_0-1665036798798.png

 

Saif1
Partner - Creator
Partner - Creator
Author

what worked was that i used networkingdays(endmonth(date),endmonth(nextmonth(date)))-13 to give me the 11th day and the length was networkingdays(Date,monthend(date) and add them togather to give me the length(business days)