superset icon indicating copy to clipboard operation
superset copied to clipboard

How to modify the order of the Pivot Table

Open Sdzspz opened this issue 8 years ago • 6 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [ ] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x] I have reproduced the issue with at least the latest released version of superset
  • [ ] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.27.0

Expected results

image

image

I use the Pivot Table to show the data.My sql is sorted correctly, but the Pivot Table sorting is different from sql.why?

Sdzspz avatar Oct 18 '18 08:10 Sdzspz

this should be fixed in master https://github.com/apache/incubator-superset/pull/5566/commits/527e398b32546ccd20ebc02b466b76f36a411fbc

yamyamyuo avatar Oct 22 '18 03:10 yamyamyuo

I tried to use 0.28.0 and 0.28.1, but this problem still exists in the new version

Sdzspz avatar Oct 23 '18 02:10 Sdzspz

interesting, https://github.com/apache/incubator-superset/blob/48b7ebea1346820ec68e8c8ae8b3d70c81fc5281/superset/viz.py#L99 this should have fixed. check if Pivot Table is inherit from class BaseViz and use this process_metrics function to generate the metrics order.

yamyamyuo avatar Oct 23 '18 05:10 yamyamyuo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 10 '19 13:04 stale[bot]

@yamyamyuo This issue is in the latest version of superset as well. Not sure where to call this function in pivot table viz function. Can you please tell me that? I have checked that base viz has the process_metric function and pivot table is inheriting it.

Neel-rishabhsoft avatar Aug 04 '20 04:08 Neel-rishabhsoft

I'm having the same issue with the latest version (1.3.2), with a Pivot Table v2. The SQL query says ORDER BY "SUM(nb_appels)" ASC but in the pivot table it seems to be order alphabetically based on Rows.

helo-ch avatar Mar 02 '22 16:03 helo-ch