27 Mar 2021 06:41 AM - last edited on 27 May 2021 02:58 PM by MaciejNeumann
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.
Solved! Go to Solution.
29 Mar 2021 09:45 AM
Hello @gofman_anatoly
Did you get a chance to look into the below documentation for the Keywords and functions, also the limitation?
Regards,
Babar
29 Mar 2021 04:26 PM
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.