Recent searches
No recent searches
Sort table rows by metric while preserving row hierarchy
Posted Mar 17, 2021
Hi all,
In a "Table" visualization, I'd like to be able to sort multiple attributes by a metric in a way that preserves their groupings. I've been trying every possible sort I can think of, but I can't figure out how to do this.
For example, imagine I have 2 attributes: Attribute 1 {A,B} and Attribute 2 {X,Y}. I'd like to be able to sort them so the table looks like this:
| Attribute 1 | Attribute 2 | Metric |
|-------------|-------------|--------|
| B | Y | 32 |
| |-------------|--------|
| | X | 12 |
|-------------|-------------|--------|
| A | X | 17 |
| |-------------|--------|
| | Y | 3 |
|-------------|-------------|--------|
Some things of note here:
- B is sorted above A because 32+12 is greater than 17+3.
- B.Y is sorted above B.X because 32 is greater than 12, and A.X is sorted above A.Y because 17 is greater than 3.
- A.X is not sorted above B.X even though 17 is greater than 12, because B is already sorted above A (per point 1).
This is trivial with a pivot table in Excel (and you can even sort each row with entirely separate value criteria), but here in Zendesk, if you sort by value descending, you would always split up A and B in that example (because A.X gets sorted above B.X).
Is there a way to do this simple hierarchy-preserving sort with Zendesk tables, or do I have to export and manipulate outside of Zendesk to get this result?
0
3 comments
RJ Hines
Good morning Owen,
Unfortunately, I'm fairly certain (after trying for a long time myself) that Explore only allows for a single 'sort' option at a time on any given query.
I re-created your example above using some data of my own. Sorting by value gives the highest total for the metric and 2nd attribute, but breaks up the 1st attribute:
However, sorting Z-A just reverses the order of the attribute, regardless of the value. The Custom Sort options only offer options between these two, nothing more refined on either end.
I'm fairly certain you may have already tried it, but I was able to create a similar result close to what you are looking for by making the 2nd attribute a Column instead of a Row and using Sort - Value Descending:
Its not as clean as the visual you demonstrated above, but with Zendesk's current limitations it may be the closest you can get. If you have too many variables in the 2nd attribute, you could potentially consider making a new Group from the 2nd attribute and narrowing it down to having 1-2 overall variables.
1
Owen Greenberg
Thanks RJ. I came to the same conclusion on my side, but wanted to be sure before I submitted a feedback post. Unfortunately, in this case, my Attribute 2 values are different depending on what Attribute 1 is because it's a dropdown hierarchy, so putting it in columns like that wouldn't help me. It's definitely a good idea, though.
I'm going to leave this open for a while in case anyone else has any input before I put in the feedback post, just in case there's any official response or other ideas.
0
Matt
Hi Owen! Unfortunately, you are correct in that you cannot sort with a hierarchy dependent filter of two attributes. You are welcome to submit that for product feedback for others to vote on and be considered.
Matt
0