The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I'm needing to find out how long certian tasks are taking. I have the columns BI_EVENT_DT_TM, BI_SO_NBR, and BI_TASK_CD. There's also BI_WRKFLW_TASK_SEQ_NBR but tasks are not always completed in the correct order so the sequence number can't be used.
In order to get the needed results I need to have my dataset order by BI_SO_NBR so I'm just finding times for tasks within their respective service order, then order by BI_EVENT_DT_TM ascending. After they're ordered in the formula I then need to subtract the time between one line's BI_EVENT_DT_TM by the BI_EVENT_DT_TM of the task that was completed after it.
So if the a service order had 2 tasks in it one timed at 12:00:00 and the next at 12:00:10 I would get a value of 10 seconds or 00:00:10 for "TASK TIME" for the first task.
This code is close but not there yet. It returns the running sum of time for each Service order and the results are off by one row.
Date Set Sample
Hopeful End Result
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
21 | |
20 | |
11 | |
10 | |
7 |