# USQL

**URL:** <https://community.dynatrace.com/t/usql/31588>\
**Category:** Real User Monitoring\
**Tags:** usql, user-sessions\
**Created:** [May 25, 2021, 1:21pm UTC](https://community.dynatrace.com/t/usql/31588 "2021-05-25T13:21:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cp\_patel](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@cp\_patel](https://community.dynatrace.com/u/cp_patel)\
**Post date:** [May 25, 2021, 1:21pm UTC](https://community.dynatrace.com/t/usql/31588/1 "2021-05-25T13:21:02Z")

</div>

Hi,

I have following requirements please help me with how can I perform them in USQL.

1) Avg. user action per session for specific application through USQL.

2) Avg. session duration for the specific application through USQL.

We want to show both the results with time series graph format. Also let me know if we can present&nbsp; these 2 results in 1 graphical format only(Separate graphs for both will also be fine and will be helpful).&nbsp;Anyhow by custom chart of USQL how is it possible to achieve?

Dynatrace offers following format to show user engagement with the application but in seconds for time user spent per session. So, to change the unit&nbsp; and also the graphical presentation we want to explore some other ways to achieve this.

 ![cp_patel_1-1621948723792.png](https://global.discourse-cdn.com/dynatrace/original/2X/f/f511af8f7ad6a2d5d7ef3b2f4af6cb0965db51f0.png)

Thanks & Regards,

Chandni

---

<div class="post-metadata">

**Author:** ![alonso\_decosio](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@alonso\_decosio](https://community.dynatrace.com/u/alonso_decosio)\
**Post date:** [May 25, 2021, 3:05pm UTC](https://community.dynatrace.com/t/usql/31588/2 "2021-05-25T15:05:58Z")

</div>

Hi&nbsp;Chandni,

You can do something like this:

SELECT endTime, avg(userActionCount), avg(duration) from usersession WHERE useraction.application = “[www.angular.easytravel.com](http://www.angular.easytravel.com)” GROUP BY endTime

 ![Screen Shot 2021-05-25 at 11.03.27 AM.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/7de64e54268d58211054df7d70d67e13d772be12.png)

I hope this helps.

Thanks,

Alonso
