marianysilva commented on issue #21425:
URL: https://github.com/apache/superset/issues/21425#issuecomment-2403128905

   We applied a small workaround here by adding invisible characters to the 
names of the days of the week to get the correct sorting. By using this field 
on the x-axis, you can sort properly. 
   
   ```
   DECODE(
     EXTRACT(DAYOFWEEK FROM OPERATIONAL_DATE_LTZ),
     1, '\uFE01Sunday',
     2, '\uFE02Monday',
     3, '\uFE03Tuesday',
     4, '\uFE04Wednesday',
     5, '\uFE05Thursday',
     6, '\uFE06Friday',
     7, '\uFE07Saturday'
   )
   ```
   
   This also works for sorting metrics. You just need to add the invisible 
character to the metric name in the YAML file.
   
   ```
   - metric_name: work
     verbose_name: "\uFE03Work"
   ```
   
   ```
   - metric_name: schedule
     verbose_name: "\uFE03schedule"
   ```
   
   ```
   - metric_name: unfilled
     verbose_name: "\uFE03Unfilled"
   ```
   ![Screenshot 2024-10-09 at 15 49 
56](https://github.com/user-attachments/assets/86b1ca93-5f80-4f79-97d7-ebeb609eb700)
   ![Screenshot 2024-10-09 at 15 45 
47](https://github.com/user-attachments/assets/de17b670-3a08-46d5-b2ef-8ce547194b34)
   ![Screenshot 2024-10-09 at 15 41 
33](https://github.com/user-attachments/assets/15b29123-bc60-4732-98eb-f3446e54863b)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to