Find the average of 95th percentile of data

I am trying to build a query using NRQL to find the average duration of SPA load time for 95% of browser interactions and not able to build the query for same.

Does NRQL support getting average of 95th percentile of data?

Hello, @PrabhakarVenkataSury: Have you tried the technique described here: https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/nrql-query-tutorials/nested-aggregation-make-ordered-computations-single-query ?

@philweber
I could not get it work with the nested aggregation.

I need to do something like this

select average(duration) from BrowserInteraction where duration < ( select percentile(duration,95) fro BrowserInteraction)

Hey @PrabhakarVenkataSury

Just a note that I brought this to the development team. This is a use case that should work in Nested Aggregation, with a query something like this:

SELECT average(95Perc) FROM (SELECT percentile(duration, 95) AS 95Perc FROM PageView) SINCE 1 WEEK AGO

However it appears that it is expected for Percentiles to not work yet with Nested Aggregation. This is a use case that the engineering team has taken on board. Though I don’t currently have a timeline on when that will be available.

Until then, I don’t think there is a way to achieve your goals of average of the 95th percentile in NRQL.

1 Like