rbosnjak commented on issue #30238: URL: https://github.com/apache/superset/issues/30238#issuecomment-2609570199
Hello! I'm dealing with the same issue. While I'm still not able to find out how to sort x-axis of bar chart based on some metric, while not showing it on the chart, I found a way how to create STRING column from VAR_STRING. To do this, you should open Edit dataset screen, and select "CALCULATED COLUMNS" tab. There you need to enter SQL expression, which will probably be just the name of the varchar column you want to convert. This will create a new column in your dataset, which is marked as String. I'm attaching 2 screenshots where this beahviour is visible.   Now, Sorting option really appears on the screen, as mentioned in the comments above.   The next thing I would like to achieve is custom sorting, based on a column which is not shown neither on x-axis or inside bar chart values (metrics field). In my scenario, I have x-axis which is formed out of dates and Identification Numbers of subjects I am analyzing. The date is in the following format: `%d.%m.%Y.` - for example `31.12.2024.`. The identification number is 11 digit number. So in the end I get x-axis value like `31.12.2024. 12345678901`. I would want to sort these on x-axis, but based on `YYYY-mm-dd` date format, since string sort does not work correctly on my time format. Note that I already track some metric for each date-subject, and I cannot add any new metric to the barchart to be visible.  Does anyone know how I could achieve this? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
