Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I need help from you guys for calculating the difference between two time stamps , below is as example of the
exact output that I need. Appreciate your help !
ID | Time Received | Action | Expected Time Difference O/P |
121 | 10/9/2017 6:00 | In | |
121 | 10/9/2017 6:30 | Out | 30 |
121 | 10/9/2017 6:50 | In | |
121 | 10/9/2017 7:00 | Out | 10 |
121 | 10/9/2017 7:10 | In | |
121 | 10/9/2017 7:30 | Out | 20 |
121 | 10/9/2017 7:32 | In | |
121 | 10/9/2017 7:43 | Out | 11 |
121 | 10/9/2017 7:47 | In | |
121 | 10/9/2017 7:50 | Out | 3 |
Thanks,
Solved! Go to Solution.
Hi @Anonymous,
glad it worked out for you. For formatting the result, you may find these additional measures useful:
DiffMinutes = QUOTIENT([Diff], 60) DiffSeconds = [Diff] - [DiffMinutes] * 60 DiffMinSec = [DiffMinutes] & "." & FORMAT([DiffSeconds],"00")
If all you need is the [DiffMinSec] you can fold it together as:
DiffMinSec = QUOTIENT([Diff], 60) & "." & FORMAT([Diff] - QUOTIENT([Diff], 60) * 60,"00")
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |