In Zendesk Support, you can create custom drop-down lists that contain multiple levels of organization. Using Explore, you can analyze the data returned by each level of your custom drop-down list.
In this Explore recipe, you'll create a drop-down list with three levels and then create some Explore reports that analyze results from it.
This recipe contains the following topics:
What you'll need
Skill level: Advanced
Time required: 20 minutes
- Zendesk Explore Professional or Enterprise
- Editor or Admin permissions (see Giving users access to Explore)
- Ticket data in Zendesk Support
- Some experience creating reports with Explore
- At least one nested custom drop-down list (see Organizing drop-down list options)
Creating the custom drop-down list
In this example, you'll create a simple nested drop-down list for a camera shop. From the Cameras list, you can select one of three cameras, Camera 1, Camera 2, and Camera 3 and select to Rent or Buy the selected camera.
To create the drop-down list
- In Zendesk Support, click (
).
- From the Admin menu, click Manage > Ticket Fields.
- On the Ticket Fields page, click Add field.
- On the Select field type page, choose Drop-down.
- Under Title shown to agents, enter a name for the field like Select your camera.
- Under Field values, enter the following values, one line for each field:
Cameras::Camera 1::Buy Camera 1 Cameras::Camera 1::Rent Camera 1 Cameras::Camera 2::Buy Camera 2 Cameras::Camera 2::Rent Camera 2 Cameras::Camera 3::Buy Camera 3 Cameras::Camera 3::Rent Camera 3
Tip: If you're working in a language other than English, read this article to help you enter Explore formulas in your language. - Once you are finished, click Save. You'll end up with something that looks like the following screenshot:
Now, the ticket field you just created will appear on your new and existing tickets. Make sure to select one of the values from this field on a few of your tickets. After Explore next updates its data (based on the schedule determined by your plan), the data will be available in Explore and you can proceed to the next section.
Creating the initial report
In this procedure, you'll create the basic report for your custom field which reports the number of tickets that have each selected combination from your drop-down list. You'll then refine this in later procedures.
To create the initial report
- In Explore, click the reports (
) icon.
- In the Reports library, click New report.
- On the Select a Dataset page, click Support > Support - Tickets, then click Start report. The report builder opens.
- In the Metrics panel, click Add.
- From the list of metrics, choose Tickets > Tickets, then click Apply.
- In the Rows panel, add your custom field, in this case Select your camera.
You'll see the results from your custom fields in a table like the following example:
While this reports the full results from the drop-down list, sometimes you might just want to return data from the second or third level of the list such as the camera model, or whether it's rented or bought. In the next topics, you'll learn how to do this.
Reporting on Level 1 fields
Now, you'll create a standard calculated attribute that returns the name of the first level of your nested drop-down field. It does this by returning the text before the first :: in the field name.
To create the Level 1 attribute
- In the report builder, with the same report opened, open the calculations menu (
), then click Standard calculated attribute.
- On the Standard calculated attribute page, name the new attribute List level one.
- In the formula window, enter or paste the following formula:
REGEXP_EXTRACT([About],"^[^::]*")
Replace About with your own custom field name.
- When you are finished, click Save.
Now, when you use this attribute, you'll only return results the first level of the results (before the first ::), in this case, Cameras.
Reporting on Level 2 fields
To find the second level, i.e. everything from the first to the second :: in the string, we need to take two steps. First, make another standard calculated attribute called List level two with a formula like:
REGEXP_EXTRACT([About],"(?<=^[^:]*::)([^:]*)")
Replace About with your own custom field name.
You now have a list of results for Level 1 and Level 2 in a hierarchy.
Reporting on Level 3 fields
Finally, if you want to display your level 3 results, make a third standard calculated attribute.
Create an attribute called List level three to create a string from the second :: in the original to the end of the string:
REGEXP_EXTRACT([About],"(?<=^[^:]*::[^:]*::)([^:]*)")
22 comments
John Burns
Hi there, my brain my just be foggy but what if we have 4 "levels"? What would category 3 prep look like? I cant seem to sort out in the attribute why its pulling level 2 vs level 3 etc. Thanks.
John
0
Tom Montgomery
Great tutorial @..., thank you so much.
I would like to ask the same question as @..., what would the attributes look like for a 4th level? I've tried and I just can't work the same magic!
Your help would be greatly appreciated.
0
Rob Stack
Hi John Burns and Tom Montgomery, I had to do a little research to get the answer to this so apologies for the delay. Here's what I received back. I hope this helps!
LEVEL 3 PREP:
IF (CONTAINS([Level 2 Prep],"::")) THEN
SUBSTR([Level 2 Prep],
FIND([Level 2 Prep],"::",0)+2,
LENGTH([Level 2 Prep]))
ELSE "" ENDIF
LEVEL 3:
IF (CONTAINS([Level 3 Prep],"::")) THEN
LEFTPART([Level 3 Prep], FIND([Level 3 Prep],"::",0) )
ELSE [Level 3 Prep] ENDIF
LEVEL 4:
IF (CONTAINS([Level 3 Prep],"::")) THEN
SUBSTR([Level 3 Prep],FIND([Level 3 Prep],"::",0)+2,LENGTH([Level 3 Prep]))
ELSE "" ENDIF
1
Theodore Wolf
Hey Team,
@...
Is there anyways we could report on just the level 3? Or would you recommend just hiding those lower levels in the chart configuration?
And could I potentially layer this with: https://support.zendesk.com/hc/en-us/articles/360052540974-Explore-recipe-Excluding-tickets-closed-by-merge
Thanks!
0
Tom Montgomery
@...
If I understand what you need correctly, it's actually pretty simple. Once you have setup all the levels above, just add "[name of level 3]" to the column or row and it will only show values that come under that category.
I hope that helps!
0
Theodore Wolf
Thanks @...!
Essentially we want to just show the level 3, as its the "meat and potatoes" of our reporting.
Im curious if you'd know, could we modify the initial metric to just show solved tickets and exclude the "closed_by_merge" tag?
We want to use this as a way to track agents solved tickets, and I think a hybrid of this post and this one would do a great job.
Thanks!
0
Tom Montgomery
Hey Theodore,
We do exactly that - we exclude the tag. It works like a charm.
I set this up almost a year ago and it took under an hour from what I remember. It's definitely worth doing.
To exclude the tag, open up your query and under "filters" add ticket tags then type closed_by_merge in the search bar. Make sure "Excluded" is selected.
Then, you can add "Level 3" in the Columns section and it will look something like this:
Note: in this example I also filtered by brand to reduce the sample size.
I hope that helps!
1
Theodore Wolf
Thanks @...!
I've tried using this setup in the past, but after spot checking a few tickets, it would still include some that had the tag. Did you do any custom metrics on this query?
0
Tom Montgomery
No problem @...,
I have noticed that too. We ignore that issue as the data gives us a good overview - a few additional merge tickets is not a huge problem to us. The solution in the article you shared above might be your best bet.
Maybe one of the Zendesk team can give some more insight into why the exclude tag feature is not 100% reliable.
0
Rob Stack
Hi Tom Montgomery, I wasn't completely sure so I've opened a ticket so someone on the team can investigate. Hopefully, you'll here from someone soon.
0
Salim Moumouni
Let's say I have three level 1 categories, website help, information update and Technical issue.
How would I roll up level 2s and level threes into the 3 main categories? Like the below
![](/hc/user_images/rP1MM4-MAX1xNx_lSJU7hw.jpeg)
0
PT Dadlani
Hi there -
Related question here, what if you want to report on the aggregate of your top level categories and the first category is not a constant? For example, we have a Product Area field that has nesting implemented that looks like:
Product 1:: Sub Product :: Sub Sub Product (so on and so forth)
Product 1 :: Sub Product 2 :: Sub Sub Product 2
Product 2:: Sub Product :: Sub Sub Product
I want to be able to pull aggregated ticket volume for all the top level categories. The formula in this article presumes the top level category is the same for all entries - but in our case it is not. Any advise or solution is appreciated.
0
Gab Guinto
The formula described above should allow you to report on top level items, even if you have multiple top level categories. Here's a sample set of nested dropdown field values and how the data will look like in Explore.
0
Vera B
Hi,
My custom field name is Category with by 5 categories, sub and sub-sub. I followed the formula:
IF (CONTAINS([Category],"::")) THEN
LEFTPART([Category],FIND([Category],"::",0))
ELSE [Category] ENDIF
But nothing appears only what looks like old tags. Any idea what else I can try?
1
Gab Guinto
We may need to take a look at the report saved in your Explore. Let me create a ticket for you.
0
Ankit Bhatia
Hi Gab,
I am trying to extract first level and second level and nothing appears in the report for me too.
0
Gab Guinto
It may be worth checking if you have another ticket or user field with an identical name. You can check out this guide: My custom ticket field attribute is not returning any results.
Let us know if this resolved the issue, or you can get in touch with the Customer Care team if you need further help. Thanks!
0
Clifford Swall
Hello, is there a video on this or a deeper explanation?
I have a gigantic tree that has over 200+ combinations that are all connected through conditional formatting.
The tree is the contact reason a customer is contacting our support team about.
Essentially there's 1 field that breaks into 10 smaller fields, and each of those smaller fields have sub fields that can go 6 levels deep, but not all go that far, some of them just 3 or 4.
Is the top most field Level 1 and the lowest field level 6?
I'd like to set up a report that is similiar to a pivot table in Excel where each level rolls up to a larger level which rolls up to a larger level and finally up to the top most level
0
Zendesk Saasten
We have 7 levels nestedloop dropdown field. And got this error:
We got this error on level 5 nested loop and the further:
Is there another formula to handle this error?
0
Zendesk Saasten
hi Rob Stack
can you help me with my question here:
https://support.zendesk.com/hc/en-us/articles/4408846701082-Explore-recipe-Reporting-on-nested-drop-down-fields#:~:text=We%20have%207%20levels%20nestedloop%20dropdown%20field.%20And%20got%20this%20error%3A
thank you
0
Alex Zheng
It looks like you opened up a ticket about this issue, someone will respond to you there and continue to assist.
0
Permanently deleted user
Hello all,
Maybe some of you have the same issue as me, namely having more than 3 levels in the nested loop field, and want to do reporting from the nested loop field but are limited by Zendesk which can only pull 3 levels from the nested loop field in the report (based on this article).
Below I have the latest formula regarding nested loops for level 1 up to whatever level you've created (without get Zendesk limitation "calculations are too complex...")
Below is the formula
Level Formula
1 REGEXP_EXTRACT([Category Detail], "([^:]*)")
2 REGEXP_EXTRACT([Category Detail], "(?<=^[^:]*::)([^:]*)")
3 REGEXP_EXTRACT([Category Detail], "(?<=^[^:]*::[^:]*::)([^:]*)")
4 REGEXP_EXTRACT([Category Detail], "(?<=^[^:]*::[^:]*::[^:]*::)([^:]*)")
5 REGEXP_EXTRACT([Category Detail], "(?<=^[^:]*::[^:]*::[^:]*::[^:]*::)([^:]*)")
6 REGEXP_EXTRACT([Category Detail], "(?<=^[^:]*::[^:]*::[^:]*::[^:]*::[^:]*::)([^:]*)")
7 REGEXP_EXTRACT([Category Detail], "(?<=^[^:]*::[^:]*::[^:]*::[^:]*::[^:]*::[^:]*::)([^:]*)")
you need to change [Category Detail] to your nested loop field
With this new formula you no longer need to create preparation attributes
hope this help, guys.
1