Forum Discussion

DDalmas's avatar
DDalmas
Frequent Visitor
5 years ago
Solved

Creare a new table including working days between dates

Hello Guys, 

 

I have this problem where there is a fact table with the a technician _id and the date that he started to work in this project and the date that he finished it.  Something like that: 

 

project_idtechnician_iddate_opendate_close
10001A12020-01-012020-01-10
10002A12020-01-012020-01-20
10003A22020-02-022020-02-20
10004A32020-02-032020-02-20

 

I'd like to count the number of distinct days that the technician has worked. It is a fact that the technician can work in several projects at the same time. Also, it counts all days between dates, incluing opening day and closing day. 

 

What is the best way to do that? 

Expected return: 
(technician_ID) - (work days)
A1 - 20 
A2 - 19

A3 - 18

 

Thanks! 

 

 

 

2 Replies