Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to calculate average duration every few rows

I have a table like this:

 

app_nameenvdeploy_datedt_diffwhat_i_need
application1dev09/03/2021 17:13:36null6 
application1dev19/03/2021 18:35:0710.01:21:316 
application1dev22/03/2021 11:59:502.17:24:436
application1uat24/08/2021 16:01:20null2
application1uat24/08/2021 16:08:342.00:07:142
application1prd06/04/2021 18:10:24null0 
application2dev22/03/2021 13:33:50null0 
application2uat11/12/2020 19:14:30null0 
application2prd09/04/2021 21:57:49null0 

 

I need the avarage of dt_diff per application and environment:

In the example above the application1 was deployed three times to the dev environment, the interval between the deploys is shown in the dt_diff and the avarage should be a sum of the dt_diff, divided by the number of dt_diff for that specific combination of application and enviornment.

3 Replies