Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I am trying to calculate the Average Turn Around Time (TAT) for a request going from one step to another step. There are a total of 8 steps and any request may go through all the steps or to some of the steps only. In addition to the start date and end date for each step, I have the calculated Turn Around Time for that specific step.
I need to calculate the amount of time it takes for a request to go from the beginning of one step to the beginning of another step (may be consecutive or not). If the steps are consecutive, the Avg(STEP_TAT) will be the correct answer. However, if the two steps are not consecutive in sequence, the Ave(STEP_TAT) will give me the average it takes for both steps to complete not how long it takes to go from the earliest step to the latest step in the selection.
I created a demo app with a bar chart that displays only when 2 selections are made. I need the bars to show the length of time it takes to go from the start date of the earliest step to the start date of the latest step in the selection. Any ideas about how to solve this?
Thanks,
Carlos
Try an expression like
SUM(
Aggr(
Max(Date#(STEP_START_DATE,'YYYY-MM-DD'))- Min(Date#(STEP_START_DATE,'YYYY-MM-DD'))
, REQUEST_ID)
)
/ Count(DISTINCT REQUEST_ID)
Note that you only need the Date#() here because your STEP_START_DATE values have not been correctly interpreted as dates in the script.
Try an expression like
SUM(
Aggr(
Max(Date#(STEP_START_DATE,'YYYY-MM-DD'))- Min(Date#(STEP_START_DATE,'YYYY-MM-DD'))
, REQUEST_ID)
)
/ Count(DISTINCT REQUEST_ID)
Note that you only need the Date#() here because your STEP_START_DATE values have not been correctly interpreted as dates in the script.
Thanks Swuehl!
It seems this is the correct solution. I'm validating now and will let you know for sure a bit later.
Thanks for your help Swuehl!