Showing results for 
Show  only  | Search instead for 
Did you mean: 

I am trying to get the count of actions per hour uisng the below query. But for some reason dynatrace is giving me results beyond the selected timeframe.


Please refer to the attached screenshot. You can see I am getting results beyond the selected timeframe. On checking with the chat support team I was told its because the user session is beyond the selected timeframe which doesn't make sense because I am querying the useraction table and not the usersession table.


Dynatrace Helper
Dynatrace Helper

The time frames in USQL refer to the time of the usersession, not to the useractions (even if the table is "FROM useraction").
Therefore, if you have a usersession lasting from 8:45 to 9:15 and your useraction is at 9:13; even if you apply a timeframe filter from 8:00 to 9:00; USQL will consider that useraction (usersession matches the timeframe), but the key performance metrics (regarding only useractions) will not.
Solution: To overcome this issue, you can add "and useraction.starttime BETWEEN ... AND ..." (which would be equivalent to useraction.starttime > ... and useraction.starttime < ..., syntax doesn't matter here) to filter only those useractions that are also part of the other dataset.


1. If I understood you correctly, if I do count(name) and filter for a user action [eg 'Save Task' ] say for 12-2pm it's going to count all the actions [i.e. Save Task] from any session that happened to be active between 12-2pm? In the below example would the count of "Save Task" be 6 instead of 2 ?

If yes that seems like a major flaw in the system, because why should it count the actions from 8am and 5pm just because the actions happened to be in the sessions that were active during the filetred times. And can I log a defect?

2. Thank you for your solution while this will work (not exactly if your answer to question 1 is Yes) my requirement is to get the count of names from 6AM to 6PM grouped by hour. So following your recommendation would force me to keep changing the timeframe and run the query 12 times (6am-6pm). Correct?

Featured Posts