Showing results for 
Show  only  | Search instead for 
Did you mean: 

USQL useraction filter not working as expected

I am trying to create a table of selected key user actions with a filter based on their name. However, whatever I try to use as filter on, the result set contains more results than the desired selection. No matter if I use IN, IS, =, STARTWITH or LIKE.




SELECT, AVG(useraction.visuallyCompleteTime) AS VCT FROM usersession WHERE useraction.application='APPNAME1' AND browserType='Desktop Browser'  AND useraction.targetUrl STARTSWITH "" AND IN ("my - some page") GROUP BY ORDER BY DESC


Other selections that appear not to have a result are  useraction.keyUserAction IS true and useraction.internalKeyUserActionId STARTSWITH "APPL"

Example of query result, with expected results in green box:





Thanks to Collin of support I was pointed out that I needed to reverse my query, using useraction not usersession, and pull the session variables from usersession.<var>, thus:

SELECT, AVG(usersession.visuallyCompleteTime) AS VCT FROM useraction WHERE useraction.application='APPNAME1' AND usersession.browserType='Desktop Browser'  AND usersession.targetUrl STARTSWITH "" AND IN ("my - some page") GROUP BY ORDER BY DESC