1

I'm trying to get a list of all browser widths used and the number of times, in order of size. So:

1920 - 12,356
1440 - 19,453
1280 - 10,847
1024 - 4,124

or something like that. It's important to list them in order of width, not usage. I'm using this:

SELECT count(browserWidth) FROM PageAction FACET browserWidth ORDER BY browserWidth LIMIT 1000

but the result I get back is ordered by most used browserWidth, not the browserWidth itself. What am I doing wrong here?

wagster
  • 498
  • 4
  • 15

1 Answers1

1

It's a bit arduous, but you can bucket them using facet cases eg:

SELECT count(*)  from PageAction facet cases
  (where browserWidth <= 1366 as '720p',
   where browserWidth > 1366 and browserWidth <= 1440 as '1440p',
   where browserWidth > 1440 and browserWidth <= 1680 as '1050p',
   where browserWidth > 1680 and browserWidth <= 1920 as '1080p',
   where browserWidth > 1920 and browserWidth <= 2560 as '1440p',
   where browserWidth > 2560 as '> 1440p')
since 30 days ago  
Chase Holland
  • 2,178
  • 19
  • 23