0

I need to be able to see pages that have increased page load duration in the current week than the previous week. I have used the following NRQL :

FROM PageView select count(*), average(duration) facet pageUrl since 1 week ago COMPARE WITH 1 week ago limit MAX

But I am unable to add another column in the Table view which displays the percentage difference between the current and previous week.

So, I tried using Nested Joins as follows:

FROM PageView JOIN (
  From PageView JOIN (
    FROM PageView
    SELECT count(*) as PrevCount, average(duration) as PrevDur
    FACET pageUrl since 2 weeks ago until 1 week ago limit max
  ) on pageUrl
  SELECT latest(PrevCount) as PreviousCount,
  latest(PrevDur) AS PreviousDuration,
  count(*) as CurrCount,
  average(duration) as CurrDur
  FACET pageUrl since 1 week ago limit max
) ON pageUrl
SELECT pageUrl, PreviousCount,CurrCount, PreviousDuration, CurrDur where PreviousCount > CurrCount

But the query returns only for 1 hour duration. How do I get the required data for 1 week duration?

PrathapB
  • 382
  • 1
  • 4
  • 15

0 Answers0