Forum Discussion

TaroGulati's avatar
TaroGulati
Helper III
1 year ago

Time difference two tables

Hi all, 

 

I am having difficulty in calculating the time difference between two tables. 

 

I need to calculate sum of time difference from table 2 between type A and B which is 21 min. This i calulated without any issue. challange is from these 21 min i have to subtract the time difference using table 1 only for the period which falls under the different dates for type A and B from table 2. For e.g from table 1 i don't have to consider row number 1 because start and end date is out of scope between dates in table 2. From table 1, row 2 and 3 should be considered because they fall under the date between row 3 and 4 of table 2. so from 21 min of table 2 i have to subtract only 11 minutes (6 minutes of row 2 and 5 minutes from row 3) from table 1. 

 

In the data model there is a possibility of relation between table 1 and 2.

Any idea how to achieve this? 

Thanks

10 Replies