8 Replies Latest reply: Nov 17, 2016 1:51 AM by Dipesh Vadgama

# Workdays ??

Hi All,

I have a date & number_of_days. I want a output Date+Number_of_days = Actual Date (Excluding Saturday & Sunday)

Excel have a formula called Workday, but I not able to calculate in Qlik sense.

Eg.

 Date No. Days Actual Date 12-Oct-16 -1 11-Oct-16 12-Oct-16 -1 11-Oct-16 17-Oct-16 2 19-Oct-16 18-Apr-16 -5 11-Apr-16 7-Apr-16 -3 4-Apr-16 6-Apr-16 -4 31-Mar-16 22-Jun-16 1 23-Jun-16 19-Jan-16 4 25-Jan-16 10-Feb-16 -3 5-Feb-16
• ###### Re: Workdays ??

yes Lastworkday function available in qlik

• ###### Re: Workdays ??

I did try, found that it give correct output for + ve No.of day's but not for -Ve No.of day's

+Ve give correct dates

-Ve give -

• ###### Re: Workdays ??

If(Date > [Actual Date], NetworkDays([Actual Date], Date)*-1, NetworkDays(Date, [Actual Date]))

• ###### Re: Workdays ??

Thank bro, But my output is Actual Date Field !!!

• ###### Re: Workdays ??

Oh, right. Well, in that case use either firstworkdate or lastworkdate depending on whether No. Days is positive or negative. Use an if statement for that and the absolute value of No. Days as second parameter to the lastworkdate or firstworkdate function.

• ###### Re: Workdays ??

You made my day, Cheers :-) Thanks.

its working perfectly.

• ###### Re: Workdays ??

I'm searching for a function or solution to add a variable amount of workdays to another variables date. I see functions as FirstWorkDay, Lastworkday and netWorkDay  but neither of them is the solution for me.

For example:

10/12/2016  - 1(days) =  10/11/2016.

10/12/2016  + 1(days) =  10/13/2016.

1/19/2016  + 4(days)   =   01/25/2016

1/19/2016 - 4(days)   =   01/13/2016

How can i do this in Qlikview?