Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi guys, I'm working with a table like the following:
Start Date | Vehicle Nr | User Name |
01 01 2020 | 001 | Max |
05 02 2020 (he renewed his contract) | 001 | Max |
03 03 2020 (which is the End date for Max using vehicle 001) | 001 | Kim |
02 01 2020 | 002 | Max |
05 05 2020 | 002 | Jana |
05 06 2020 | 001 | Max |
05 10 2020 | 001 | Marc |
I need to create a table that shows how long the user used the vehicle:
User | Vehicle Nr | Start date | End date |
Max | 001 | 01 01 2020 | 03 03 2020 |
Kim | 001 | 03 03 2020 | 05 06 2020 |
Max | 002 | 02 01 2020 | 05 05 2020 |
Max | 001 | 05 06 2020 | 05 10 2020 |
It's very complex to find a solution for that, I would be thankful for anything! Thank you!
@chemmario , is first and last, is not for the same user, same Vehicle ?
How do we decide where to stop max and start min again
The problem is that a user can rent that car a second time and there will be a second Start and End Date, so you cant solve it by just focussing on the Max date
You need to pick up the start date and look for the next bigger date for the same vehicle with a different user. That would be the end date for the first period
User | Count |
---|---|
90 | |
74 | |
67 | |
63 | |
55 |
User | Count |
---|---|
99 | |
88 | |
72 | |
60 | |
59 |