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: ?

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

Hi @PrabhakarVenkataSury,

I wanted to provide a quick update - we’ve added support for nested percentiles, so a query like the one @RyanVeitch mentioned should work now.

Let us know if you run into issues!

1 Like