FACET results inside of a filter()?

I have a query across two event types to calculate a percentage of JavascriptErrors. The query looks like this

SELECT 100 * filter(uniqueCount(sessionId), WHERE eventType()='JavaScriptError' AND errorMessage = 'SOME_ERROR_MESSAGE') / filter(uniqueCount(sessionId), WHERE eventType()='PageAction' AND actionName='heartbeat') FROM PageAction, JavaScriptError TIMESERIES 5 minutes

Our application sends a ‘heartbeat’ page action every 5 minutes so this query calculates the % of sessions that produce a ‘SOME_ERROR_MESSAGE’ JavascriptError.

In summary, SELECT 100 * [Number of sessions with SOME_ERROR_MESSAGE] / [Number of sessions]

I’d love to FACET the JavascriptError filter on errorMessage so I can graph all error messages as a percentage. At the moment I have to layer multiple versions of the same query onto a graph, each one with a different error message.

Does anybody know if this is possible?

Hi @ashley.byrom - Have you tried using an IN and then add FACET errorMessage?

errorMessage IN('SOME_ERROR_MESSAGE', 'SOME_OTHER_ERROR_MESSAGE')

Thanks for your response @stefan_garnham

The x IN(...) FACET x works if I’m only querying JavascriptErrors.

I think because my example query is a union on JavascriptError and PageAction the FACET only works on attributes that exist on both JavaScriptErrors and PageActions.

If I try FACET inside of my JavascriptError filter(...) I get a syntax error.

fwiw the result of my second query on PageAction (filter(uniqueCount(sessionId), WHERE eventType()='PageAction' AND actionName='heartbeat')) will be constant for each time-series time range regardless of the errorMessage.

It’s almost like I need two separate queries:

  1. a TIMESERIES of JavaScriptErrors with FACET errorMessage
  2. a TIMESERIES on PageAction without a FACET

And then the ability to divide all of the data points in (1) by the corresponding time-series value in (2)

Hi @ashley.byrom,

I wanted to check if you are still having some issues related to this issue.

Hi @GlenOFoghlu.

Yes as far as I am aware it is not possible to FACET across multiple data sources

well that depends, you can do

select count(*) from transaction, transactionTrace facet AppName

Note the two different tables, but you cant do it across different accounts.