Hi all, I have a question regarding dashboard filt...
# gooddata-cloud
g
Hi all, I have a question regarding dashboard filters. The values shown in the dropdown are sorted (in my case I guess Alphabetically). Is there a way to retain the sorting in the source table?
i
Hi Goran, You can sort an attribute by a specific label in an ascending (A → Z) or descending (Z → A) order. But I assume, this is not what you are up to. May I know how are your values sorted in your data source and what is the desired outcome? The default sorting should be alphanumerical, AFAIK.
g
HI @Ivana Gasparekova my labels are somehow alphanumeric and 11 and 20 come before 4 🙂 Example: less than 11, less than 20, less than 4
i
Yeah, I see - as it takes the first digit for sorting and not the actual number. Let me check internally how can we fix this. I will get back to you with my findings shortly.
m
Hi Goran, I believe the default sorting for an attribute depends on how the underlying database sorts the column to which the attribute is mapped (i.e. if it is string/varchar it sorts alphabetically, if it is integer it sorts numerically). And there is a way how to override the sorting of an attribute in GoodData - you can define another column in the same database table by which the attribute will be sorted. This column even does not need to be represented in the data model by its own attribute or label. To do it in the modeller click those three dots next to the attribute (they only appear if you move the mouse over it), then click “Sort by…” and select which column to use for sorting. You can also change sorting order - descending or ascending.
🙌 2