Recent searches


No recent searches

How do I avoid hitting the "50000 rows in the SQL query" limit when creating custom metrics?

Answered


Posted Jan 21, 2021

Hi everyone,

I have created a standard calculated metric in the ticket updates dataset using a numeric custom field:

The metric follows the same logic as the Zendesk standard metrics (e.g., Tickets created):

If I apply this to the data of one individual day it returns a number, however, as soon as I include data of more then one day, no data is returned and I get a warning that the SQL query returns more than 50000 rows.

Does anyone have an idea why this is not working? Is it possible that this has something to do with "ACD Anzahl Outboundcalls" being a "numeric custom field" and not a "ticket custom field"? And has anyone any ideas how to fix this? I have tried limiting the custom metric to only tickets that have an entry in this field but so far haven't had any success.


1

2

2 comments

image avatar

Hannah Meier

Zendesk Customer Care

Hello @...,

There is a data threshold of 50,000 rows on the underlying SQL in Explore. Explore is only able to query 50,000 rows of data at a time and displays the Network Error if that limit is exceeded. Bear in mind that this limit doesn't necessarily translate to 50,000 rows on the query itself, it also depends on the number of columns included, type of data calculated, etc.

Using standard calculated metrics in queries will add to the number of rows that need to be queried in SQL because it adds to the complexity of the queries.

To resolve this issue, narrow the query scope to prevent the exceeding of the data threshold. You can narrow the query scope by adjusting existing date and data filters or adding new ones. In Explore, query filters are applied to the data before calculated metrics/attributes are applied, so filtering down your data before it is sent to the calculation engine is the best way to prevent these errors. Below are some options for adding filters to your query to make it perform better

Adding a redundant data filter

In the example above, you have a calculated metric to only count specific tickets. You can add data filters to narrow down the data before it gets sent to the calculation engine.

For example, adding a query filter on the [Changes - Field name] attribute set to "ACD Anzahl Outboundcalls" in your query above should make this query run more efficiently.

Adjusting an existing date filter

  1. Select an existing date filter on your query (for example, Ticket created - Date).
  2. Make the defined date range smaller (for example Yesterday) to reduce the data computation required.

Adding a new date filter

Follow the steps in Editing dates and date ranges to add a new date filter with a specific date range.
If the Network error message persists, make the date range smaller.

 

0


Hello  @...,

Thanks for the help!

I am very aware of that 50000 row limit, since I hit it pretty much every time when I create a query using custom metrics in the updates dataset. Usually I can solve it with some additional time filters but in this case it didn't help, because if I need to get the data for a year, I don't really want to get it for each day individually and then add it up later... ;) 

I was stuck because I expected the line "[Changes - Field name]="ACD Anzahl Outboundcalls"" to already limit the query to those cases. An additional query filter for [Changes - Field name]="ACD Anzahl Outboundcalls" actually solved the problem :)

 

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post