# Bar Chart for User session query

**URL:** <https://community.dynatrace.com/t/bar-chart-for-user-session-query/21434>\
**Category:** Dashboarding\
**Tags:** data-explorer, user-actions\
**Created:** [July 31, 2019, 12:52pm UTC](https://community.dynatrace.com/t/bar-chart-for-user-session-query/21434 "2019-07-31T12:52:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthew\_k](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@matthew\_k](https://community.dynatrace.com/u/matthew_k)\
**Post date:** [July 31, 2019, 12:52pm UTC](https://community.dynatrace.com/t/bar-chart-for-user-session-query/21434/1 "2019-07-31T12:52:09Z")

</div>

I’ve created naming rules for user actions and hopefully this is the best way to chart this data for payments. My query is successful as a single value which is great, now I need a bar chart for the same count. Can I get an example on how to create a bar chart for this query and any other advice on a better mouse trap?

SELECT COUNT(usersession.userId) AS Users FROM useraction WHERE name = “My Payment Methods” or name = “Pay Now” or name = “Pay Selected Bills” or name = “Pay My Bills” or name = “Make Future Payments”

I need count charted, not response time. Examples are awesome. Thanks

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [July 31, 2019, 2:32pm UTC](https://community.dynatrace.com/t/bar-chart-for-user-session-query/21434/2 "2019-07-31T14:32:33Z")

</div>

You have to use group by name

sebastian

---

<div class="post-metadata">

**Author:** ![jonathan\_schull](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jonathan_schull/32/15062_2.png) [@jonathan\_schull](https://community.dynatrace.com/u/jonathan_schull)\
**Post date:** [July 31, 2019, 2:39pm UTC](https://community.dynatrace.com/t/bar-chart-for-user-session-query/21434/3 "2019-07-31T14:39:33Z")

</div>

Hi Matt,

To get this to display as a Bar Chart you will need to select the useraction name, as well as group the results by something (probably user action name in this case).

Try this query:

SELECT useraction.name AS ‘User action name’, COUNT(usersession.userId) AS Users FROM useraction WHERE name = “My Payment Methods” or name = “Pay Now” or name = “Pay Selected Bills” or name = “Pay My Bills” or name = “Make Future Payments” GROUP BY useraction.name

Jonathan
