You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "marianysilva (via GitHub)" <gi...@apache.org> on 2024/10/09 18:55:49 UTC
Re: [I] Missing combination in data leads to odd sorting on Bar Chart v1 [superset]
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"
```



--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org