apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.71k stars 13.84k forks source link

[filter box] sort values in the filter #2367

Closed bkyryliuk closed 6 years ago

bkyryliuk commented 7 years ago

allow user to sort the values in the filter

bkyryliuk commented 7 years ago

there is a workaround via specifying the metric to be MAX or MIN

agriffis commented 7 years ago

It would be nice to divorce the sort from the metric, or make it selectable. Some filters (e.g. customer name) really want to be in alphabetical order. Other filters want to be in reverse alpha order, such year/quarter strings with the most recent at the top.

caseye commented 7 years ago

Agree with the workaround, but to clarify agriffis, due to the way the query is written by the system it creates a lot of wackiness. For example,


SELECT ad, "DC_Sort" FROM (SELECT ad AS ad, min(ad) AS "DC_Sort" FROM "GGEBHART"."VW_HARDWARE_PIPELINE_UNP_ANAL" WHERE event_date >= TO_TIMESTAMP('2017-07-06T17:44:05', 'YYYY-MM-DD"T"HH24:MI:SS.ff6') AND event_date <= TO_TIMESTAMP('2017-07-13T17:44:05', 'YYYY-MM-DD"T"HH24:MI:SS.ff6') GROUP BY ad ORDER BY min(ad) DESC) WHERE ROWNUM <= 50000

-Why does the order by default to DESC with no seeming ability to change? -Why is it limiting Rownum to under 50,000? I mean for performance, yes... but what if I need it to look in more rows? --Why is there an inherent time series when this has nothing to do with time?

I would actually argue that the real need is an ability to manually alter the system-generated SQL statement to make it do what you need.

mistercrunch commented 6 years ago

Notice: this issue has been closed because it has been inactive for 283 days. Feel free to comment and request for this issue to be reopened.

csc5k commented 6 years ago

+1 I think it would make sense to have options within the filter slice to default sort order to alphabetic

mosche commented 5 years ago

From a dashboard consumer perspective that is in deed one of the major UX flaws of our dashboards. In some cases the current sort order is just not intuitive at all and an optional alphabetic sort order would improve things greatly!

mosche commented 5 years ago

Would be great to reopen this @mistercrunch Also, related: https://github.com/apache/incubator-superset/issues/3272

mistercrunch commented 5 years ago

Finally got around to this here https://github.com/apache/incubator-superset/pull/6523