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

Function usage in USQL query in WHERE statement

gofman_anatoly
Participant

Hello

If there a way to create USQL query with function (for example - AVG) in WHERE statement?

Sample - a query that returns count of user actions where visually complete time more when average for this user action.

select count(visuallyCompleteTime) FROM useraction where name="%something%" and visuallyCompleteTime > AVG(visuallyCompleteTime)

 

Best Regards

Tolik.

2 REPLIES 2

BabarQayyum
Leader

Hello @gofman_anatoly 

Did you get a chance to look into the below documentation for the Keywords and functions, also the limitation?

https://www.dynatrace.com/support/help/how-to-use-dynatrace/real-user-monitoring/how-to-use-real-use...

Regards,

Babar

trevor_masseng1
Dynatrace Pro
Dynatrace Pro

Hi,
It is not possible to do this with a single USQL query, but it is possible to make this comparison manually between two USQL tiles, or automatically with two API requests.
I'd recommend either creating a dashboard tile with the Avg user action duration as a Single Value, and another with each user action w/visually complete time printed out in a table for comparison.
Or using the USQL API to run both queries outside of Dynatrace, extracting entries from one JSON response that exceeded the average found by the other request's response.