How can i sort y axis with category name #42790
Replies: 1 comment 1 reply
|
@PARKER-X The trick is to keep your text labels as the dimension and use the numeric CASE expression as a separate sorting metric — not as the dimension itself. Here's how:
This way the chart displays the text labels but orders them by the hidden numeric value. Simpler alternative: If the above doesn't work well for your chart type, you can prefix the labels with zero-padded numbers in your CASE expression [1]: CASE
WHEN experience_band_sort = 1 THEN '01. 0-5 yrs'
WHEN experience_band_sort = 2 THEN '02. 5-10 yrs'
WHEN experience_band_sort = 3 THEN '03. 10-15 yrs'
WHEN experience_band_sort = 4 THEN '04. 15-20 yrs'
WHEN experience_band_sort = 5 THEN '05. 20+ yrs'
ENDAlphabetical sorting will then naturally produce the correct order. Note: Superset doesn't have a built-in UI for arbitrary custom category ordering, so a data-driven approach like one of these is the standard way to handle it [2]. To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
Uh oh!
There was an error while loading. Please reload this page.
how can i sort 0-5,5-10 etc

I tried CASE experience_band_sort
WHEN 1 THEN '0-5 yrs'
WHEN 2 THEN '5-10 yrs'
WHEN 3 THEN '10-15 yrs'
WHEN 4 THEN '15-20 yrs'
WHEN 5 THEN '20+ yrs'
ELSE 'Unknown'
END
if i use experience_band_sort than it works but don't want 1,2,3,4,5 etc i hope u understand what am i trying to say
All reactions