Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

How can I compare now to a specific week a year ago

nrql

#1

I have a query that works fine if I manually change the number of weeks ago it is comparing to
SELECT count(*) FROM Transaction WHERE appName LIKE ‘CBAP%’ TIMESERIES 1 minute since 6 hours ago COMPARE WITH 48 weeks ago

I would like to calculate what the number of weeks is based on the week being the first week in November of 2017.


#2

You can do like this, but you cannot use timeseries. You cannot make the comparewith function anything other than relative to the since and until.

select filter(count(*), where weekOf(timestamp) = 'Week of October 1, 2018') as 'Week of October 1, 2018', filter(count(*), where weekOf(timestamp) = 'Week of September 17, 2018') as 'Week of September 17, 2018' from Transaction where appName = 'foo' since 2 month ago


#3

Looks like 11 months

COMPARE WITH 48 weeks ago


#4

Hey @monitoringLife just wondering if you got everything you need from @6MM’s suggestion? :slight_smile: