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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
vsap2000
Creator
Creator

Adding weekend days to Weekdays

Hello,

I have 3 dates TC_Date, TS_Date, TE_Date. I have to count number of exact weekdays

LineDays = Num(Networkdays(Tc_Date,TS_Date)-2 + (1+Frac(Tc_Date) + Frac(Ts_Date),'#0.00')

WkDays = Num(Networkdays(TS_Date,TE_Date)-2 + (1+Frac(TS_Date) + Frac(TE_Date) ,'#0.00')

TotDays = Num(Networkdays(Tc_Date,TE_Date)-2 + (1+Frac(Tc_Date) + Frac(TE_Date), '#0.00')

TotHours = Num((Networkdays(Tc_Date,TE_Date)-2 + (1+Frac(Tc_Date) + Frac(TE_Date))*24, '#0.00')

these all expressions gives correct Num of Weekdays & hours but if either of Dates fall on weekend I get # of days & hours  in negative, it's not calculating correctly.

So my requirement is if TC_Date falls on weekend Saturday use previous day Friday if Sunday use next day Monday, if TS_Date falls on Saturday/Sunday use next working day that is Monday, TE_Date falls on Saturday/Sunday use Monday, can anyone help me how to add working days to above expression?

Thanks in advance.

0 Replies