Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sk88024
Contributor III
Contributor III

Networkdays

Hello Experts,

Could you please help to get the below output as explained.

 

Please find the attached image for your reference. 

So, in order to calculate the networkdays between ERD and Modified On,

1. the first row should pick the first values from both the columns, hence networkdays = 0

2. Networkdays = 1 where ERD is from the 2nd row i.e., 2nd Jan and Modified on from last loaded (or first row) i.e., 1st Jan

3. Networkdays = 1 where ERD is from the 3rd row i.e., 3rd Jan and Modified on from last loaded (or Second row) i.e., 2nd Jan

1 Solution

Accepted Solutions
Kushal_Chawda

Data:
Load * Inline [
ERD,ERD Date, Modified On
ERD,01/01/2020 14:23:00,01/01/2020 14:27:00
ERD,02/01/2020 14:23:00,02/01/2020 10:27:00
ERD,03/01/2020 14:23:00,03/01/2020 10:27:00 ];

New:
NoConcatenate
Load *,
     if(RowNo()=1,Floor([ERD Date])-floor([Modified On]),floor([ERD Date])-Previous(floor([Modified On]))) as NetWorkDays
Resident Data
Order by [ERD Date];

Drop  Table Data;

View solution in original post

2 Replies
Kushal_Chawda

Data:
Load * Inline [
ERD,ERD Date, Modified On
ERD,01/01/2020 14:23:00,01/01/2020 14:27:00
ERD,02/01/2020 14:23:00,02/01/2020 10:27:00
ERD,03/01/2020 14:23:00,03/01/2020 10:27:00 ];

New:
NoConcatenate
Load *,
     if(RowNo()=1,Floor([ERD Date])-floor([Modified On]),floor([ERD Date])-Previous(floor([Modified On]))) as NetWorkDays
Resident Data
Order by [ERD Date];

Drop  Table Data;
Brett_Bleess
Former Employee
Former Employee

Did Kush's post get you what you needed?  If so, do not forget to return to your thread and use the Accept as Solution button on his post to give him credit for the help and to let other Community Members know that worked.  If you still need further assistance, please leave an update post.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.