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 to query for latest versions (automatically)?


#1

I would like to query a custom attribute grouped by mobile app version and create a Dashboard. However I’d like to only see the latest app versions, older versions have no interest and distort the values since their user base decreases with time.

I have something like this:

SELECT percentile(timeElapsed, 50) FROM MobileCustomEvent FACET appVersion WHERE appName = 'iOS' AND name = 'dataReady' TIMESERIES

I know I could set a base version like:

SELECT percentile(timeElapsed, 50) FROM MobileCustomEvent FACET appVersion WHERE appName = 'iOS' AND name = 'dataReady' AND appVersion > '2.1.0' TIMESERIES

but I’d like a chart I don’t have to manually update (‘2.1.0’ is fine today, but not in a couple of months).

Is it possible to somehow just take into consideration the latest N versions?

(limit does not seem to help here, since results cannot be ordered afaik)


#2

See if you have and can use appVersionId to filter out lower versions. I’m skeptical you can do > ‘2.1.0’.


#3

Actually you can. That’s what I am doing at the moment. But I’d like a dynamic query and not having to increment the version manually from time to time.


#4

NRQL params is something we have requested as an enhancement. That kind of thing could help you. LIke using a filter on the dashboard we’d like to be able to set values of params that can be used in NRQL for use in math and comparisons etc.

What kind of logic would you use to determine your dynamic threshold appversion?

You can use the api’s to update dashboards. In this way you can script your version updates to the NRQL using whatever external logic you can cook up.


#5

@xavi.gil - Hey there! It looks like @6mm was able to get you the right information. Right now there is no way to have dynamic queries that auto update to only look at latest versions.

I do like @6mm’s workaround of using the API to update your dashboards/queries. Is that something you could try?


#6

I guess it could be a solution but it is overkill for my case. It is easier to change it manually than having to use the API.

I was looking for an easiest approach, something like an ORDER BY plus a LIMIT clause or similar.

Anyway, thanks for your help.