Replies: 1 comment 3 replies
-
To achieve sorting based on one column while displaying another in Superset, you can use the "Sort Metric" feature. Here's how you can configure it:
Here's a general approach:
This setup allows you to display the formatted date while sorting by the actual date, ensuring proper alignment and order in the dropdown. Regarding the error with |
Beta Was this translation helpful? Give feedback.
-
I have a virtual dataset that I use for filtering, which utilizes a PostgreSQL database to generate a range of dates:
Currently, I use a Value filter that allows users to select date(s) from a dropdown menu. I would like the filter values to be well-aligned and sorted. However, when using string-format dates ('DD.MM.YYYY'), the output is not visually appealing:
01.01.2015
,01.01.2016
,01.01.2017
, etc. (See the attached image.)And I need
01.01.2015
,02.01.2015
,03.01.2015
, etc.Is it possible to display values from one column (specifically
startdate_str_format
) while sorting based on another column (namelystartdate
)?I attempted to create a custom metric for sorting purposes with
RANK() OVER(ORDER BY startdate DESC)
, but encountered an error:column "virtual_table.startdate" must appear in the GROUP BY clause or be used in an aggregate function LINE 3: order by startdate DESC
Any help is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions