Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Karthick30
Creator
Creator

Date Difference Calculation

 Hi,

 I need to calculate Date Difference between 2 dates excluding Weekends. I am using NetWorkDays fuction.

If I have Start Date as 7/6/2022 and End Date as 7/7/2022 , my result for NetworkDays function is showing 2. I got  it as consider StartDate count as 1 and End Date count as 1. so result is 2. 

But Actual Difference between 7/6/2022 and 7/7/2022 is 1. I need the result as 1

Any way to achieve this Please

 

Labels (2)
2 Solutions

Accepted Solutions
sidhiq91
Specialist II
Specialist II

@Karthick30  What you mentioned is right, networkdays returns 2 as a result. May be to return as 1, we might need to just subtract by 1.

NetWorkDays('07/06/2022','07/07/2022')-1

You can provide some real world data to look into it further.

View solution in original post

GnaneswarReddy
Contributor III
Contributor III

Use this NetWorkDays(Startdate,Enddate)-1

By subtracting 1 , we are ensuring that Start date wont be considered . 

View solution in original post

2 Replies
sidhiq91
Specialist II
Specialist II

@Karthick30  What you mentioned is right, networkdays returns 2 as a result. May be to return as 1, we might need to just subtract by 1.

NetWorkDays('07/06/2022','07/07/2022')-1

You can provide some real world data to look into it further.

GnaneswarReddy
Contributor III
Contributor III

Use this NetWorkDays(Startdate,Enddate)-1

By subtracting 1 , we are ensuring that Start date wont be considered .