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

FACET by a property which isn't in all events

nrql
insights

#1

###Insights Question Template

  • I would like to FACET by a property which isn’t in all the events. Some events come with that property and some don’t possess that property. Is there a way I can facet the count by that property. Currently FACET by default doesn’t show the count of events that doesn’t have the property.

Ex., SELECT count(*) from PageView WHERE pageUrl LIKE ‘%/bundle/config_%’ TIMESERIES AUTO FACET pageGroup

Lets say some events have pageGroup as ‘HomePage’ and some don’t. I would need results as

HomePage 900
NULL 1111

Is it possible to achieve by any means?


#2

I figured it out myself :slight_smile:

Achieved it through FACET cases() :smiley:


#3

@sarnathkj good to hear you got this resolved with FACET cases() - let us know if we can help any further.


#4

Hey @sarnathkj, FACET cases() is a great way to address this! Would you be willing to share your final query with the community?


#5

Here you go,

SELECT count(*) from PageView WHERE pageUrl LIKE '%/bundle/config_%' FACET cases(WHERE pageGroup='pageGroupName' AS 'RequestsWithPageGroup', WHERE pageGroup!='pageGroupName' AS 'RequestsWithoutPageGroup')