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

Query multiple applications

JGannon
Guide

Hi

 

I have 10+ applications where I want to get the screen widths. If I write the query for a single app the query works and I can get data for 365 days.

 

SELECT screenWidth as width, screenHeight as height, count(*) as "Session count" from usersession where useraction.application = "applicationname" group by screenWidth, screenHeight ORDER BY count(*) DESC

 

If I include ADD, (see below) the query fails as it tells me the data is limited to 51 and use TOP. Any idea as how I can get the data for all apps in a single query?

 

SELECT screenWidth as width, screenHeight as height, count(*) as "Session count" from usersession where useraction.application = "app1" AND useraction.application = "app 2" group by screenWidth, screenHeight ORDER BY count(*) DESC

4 REPLIES 4

dannemca
DynaMight Champion
DynaMight Champion

Can you confirm that you are seeing all data in frist query? It should be also limited to 51, based on tests I have done in my env.

 

Also, RUM data is stored for 35 days maximum, you will not get 365 days anyway.

Site Reliability Engineer @ Kyndryl

JGannon
Guide

In the 1st query I get the data but it says "The default number of results aggregated from all screenHeight fields is limited to 51. To modify this limit, use the TOP() function in SELECT." 

When I do the 2nd query I see no data at all.

dannemca
DynaMight Champion
DynaMight Champion

Oh I understood now.

Change the AND condition in Where to OR.

 

SELECT screenWidth as width, screenHeight as height, count(*) as "Session count" from usersession where useraction.application = "app1" OR useraction.application = "app 2" group by screenWidth, screenHeight ORDER BY count(*) DESC

 

When using AND, you are querying the sessions that shares both apps. Change to OR and you will get the data from both apps independently .

Site Reliability Engineer @ Kyndryl

JGannon
Guide

Great..this works. Thanks much for the quick reply