How to filter my query results from least to greatest?

Hello. I have a query similar to this…

SELECT percentage(count(*), WHERE statusCode = 403) as ‘403 Error Rate %’ FROM MobileRequestError, MobileRequest FACET CASES(WHERE requestPath LIKE …) OR requestPath TIMESERIES LIMIT 3

That returns a line chart representing the failure rates for each of the requestPaths. Currently by default, the results are filtered from highest to lowest failure rate, but I would like this query to return the lowest three failure rates instead. Is there any way to do this?

Hi, @menelik.gebre: Try multiplying by -1:

SELECT percentage(count(*), WHERE statusCode = 403) * -1

Hey @philweber , that ended up doing the trick so thanks a ton!

So now that the query returns the failure rates in descending order, I’m actually running into a new problem. I have a lot of failure rates that are at 0% and would like to exclude these from query results. Is there a way to accomplish that?

If you are using the above query its likely not zero, but rounded to zero in the presentation. Check the json response for the query vs the chart or table to confirm.

1 Like