androidiosnewrelicnrql

How to get unique AppVersion on unique Uuid in New Relic using NRQL?


I can get the usage on each version using NRQL

SELECT count(*) FROM MobileSession since 1 day ago WHERE (appName = 'app-name') 
FACET (appVersion) limit MAX

but these are not unique Uuid, i.e. the same person/uuid having multiple session would be reported multiple times.

If I want unique UUID i.e. each version only reported once for each uuid, I thought I can use Sub-Query

SELECT count(*) FROM (
    SELECT count(*) FROM MobileSession WHERE (appName = 'app-name') 
    FACET appVersion, uuid limit MAX
) since 1 days ago FACET appVersion limit MAX

However, then I realize subquery only limit to 2000 entries

This makes the data incorrect as I increase the days value.

How can I use NRQL to get unique user using my App, group by the version they are using (across multiple days)?


Solution

  • The uniqueCount() function should allow you to get the results you are looking for:

    SELECT count(*) as 'Total Records' uniqueCount(uuid), uniqueCount(deviceUuid), uniqueCount(deviceManufacturer) FROM MobileSession since 1 day ago WHERE (appName ='app-name') 
    FACET (appVersion) limit MAX
    

    Note, I've added several different attributes (deviceUuid, deviceManufacturer) to illustrate the differences.