# USQL - time beetwen steps

**URL:** <https://community.dynatrace.com/t/usql-time-beetwen-steps/19677>\
**Category:** Real User Monitoring\
**Tags:** usql\
**Created:** [June 25, 2020, 10:25am UTC](https://community.dynatrace.com/t/usql-time-beetwen-steps/19677 "2020-06-25T10:25:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MAkimov](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@MAkimov](https://community.dynatrace.com/u/MAkimov)\
**Post date:** [June 25, 2020, 10:25am UTC](https://community.dynatrace.com/t/usql-time-beetwen-steps/19677/1 "2020-06-25T10:25:06Z")

</div>

Hello

can I calculate the time between two steps in a User session through USQL?

For example, the time from the start of the purchase to payment for the goods?

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [June 25, 2020, 12:06pm UTC](https://community.dynatrace.com/t/usql-time-beetwen-steps/19677/2 "2020-06-25T12:06:44Z")

</div>

You could put in the duration time of action x and make another USQL for action Y. You could also mark the requests as Key request and formulate a chart off of that or even conversion goals

---

<div class="post-metadata">

**Author:** ![MAkimov](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@MAkimov](https://community.dynatrace.com/u/MAkimov)\
**Post date:** [June 25, 2020, 12:55pm UTC](https://community.dynatrace.com/t/usql-time-beetwen-steps/19677/3 "2020-06-25T12:55:53Z")

</div>

I need a metric not the sum of two steps, but the duration of the period in the session between two steps.

we have a metric for the duration of the session. So I need only part of this metric regarding the two steps of the user in the funnel

---

<div class="post-metadata">

**Author:** ![JamesKitson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jameskitson/32/22460_2.png) [@JamesKitson](https://community.dynatrace.com/u/JamesKitson)\
**Post date:** [June 25, 2020, 2:34pm UTC](https://community.dynatrace.com/t/usql-time-beetwen-steps/19677/4 "2020-06-25T14:34:26Z")

</div>

No the only place this is available to any extent is if you’re looking at a single user’s session where you can see all of the user actions in order but there’s no way to get this as a metric or even as number from usql.

With usql you can get start times and end times by querying the user action table but you’d be querying both relevant user actions you can’t have data from both of them in the same row. And if you queried from the usersession table you can pull from the useractions but you can’t get the starttime from two actions separately, there’s just no way to express that.

You’d need to be able to do something like **select action1.startTime - action2.startTime as difference from usersession** which you cannot do.

---

<div class="post-metadata">

**Author:** ![MAkimov](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@MAkimov](https://community.dynatrace.com/u/MAkimov)\
**Post date:** [June 25, 2020, 7:15pm UTC](https://community.dynatrace.com/t/usql-time-beetwen-steps/19677/5 "2020-06-25T19:15:56Z")

</div>

pity that there is no such. This is a very useful indicator for business.

maybe I create an RFE. maybe developers will create when not

---

<div class="post-metadata">

**Author:** ![Saravanakumar\_P](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/saravanakumar_p/32/19257_2.png) [@Saravanakumar\_P](https://community.dynatrace.com/u/Saravanakumar_P)\
**Post date:** [July 2, 2021, 1:31pm UTC](https://community.dynatrace.com/t/usql-time-beetwen-steps/19677/6 "2021-07-02T13:31:31Z")

</div>

Yes. This is very useful information for business,&nbsp;&nbsp;we have useraction.startTime information in the useraction but we are not able to use it wisely for our analysis. Extracting data via USQL API and query the time difference from another tool would not be an ideal way for a single use case(this involves exporting data and requires elasticsearch or an ideal tool in Prod enV).

[https://community.dynatrace.com/t5/Dynatrace-product-ideas/USQL-to-find-duration-between-two-steps/idi-p/168660](https://community.dynatrace.com/post/168660)
