Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
clondono
Creator III
Creator III

How to calculate Turn Around Time between 2 steps

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?

1.png

Thanks,

Carlos

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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.

View solution in original post

3 Replies
swuehl
MVP
MVP

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.

clondono
Creator III
Creator III
Author

Thanks Swuehl!

It seems this is the correct solution.  I'm validating now and will let you know for sure a bit later.

clondono
Creator III
Creator III
Author

Thanks for your help Swuehl!