Hi all. What's the easiest way to set the sort ord...
# gooddata-platform
m
Hi all. What's the easiest way to set the sort order for an attribute? For example, I have a stacked column graph where I stack by a field called Criticality. The possible values for criticality are Highest, High, Average, Low, Lowest and Not Specified and I'd like to see them in this order. But currently they are showing up in alphabetical order in filters and legends. Thanks for your help!
m
In the hosted GoodData platform, you can add a sprting label to your model. That means add an additional "label" to your Criticality column that will be used for its sorting. https://community.gooddata.com/data-models-58/custom-sorting-order-does-not-work-311
m
Thanks Michal - that link shows how I could sort it in ascending or descending alphabetical order. But I want to sort it in a different order, so I still don't quite understand. Are you saying that I would need a new column in my source data that represents the 'criticality' as a number so that I can sort based on that? E.g. a source column called 'Criticality ID' where 1 = 'highest criticality', 2 = 'high criticality' etc. which I then add as a label to my Criticality attribute? That seems like a lot of effort just to sort in a specific order?
m
Yes, Mal, exactly, to achieve this in GoodData, you define additional column (either numerical or alphabetical) and define it as sorting for the other column in the LDM. And GoodData will then always sort your “Criticality” by “Criticality ID” - in tables, in charts, in filters, etc.
m
OK, thanks @Michal Hauzírek - I will give it a try