apache / superset

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

Sort by is not working for Pivot Table and Pivot Table V2 chart #23353

Open bonamim opened 1 year ago

bonamim commented 1 year ago

Sort by is not working for Pivot Table and Pivot Table V2 chart.

How to reproduce the bug

  1. Create a [Pivot Table] or [Pivot Table V2] chart;
  2. Add some fields in Row section and one metric in the Metrics section;
  3. Try to sort the data using the metric.

Expected results

When SORT DESCENDING is selected, the data in the pivot table should be in descending. It is possible to see in the images below that the sorting is respected in the Results section, but in the pivot table nothing happens.

Actual results

Environment

Checklist

Make sure to follow these steps before submitting your issue - thank you!

Additional context

Sansinj commented 1 year ago

Same problem here :(

HeathLee commented 1 year ago

Same problem

smiren commented 1 year ago

Same problem

smiren commented 1 year ago

The same problem here

gajendersingh1982 commented 1 year ago

Same problem seen by me

seantdinh commented 1 year ago

same here :( , please fix because it makes the table not usable for the user to quickly look at a lot of data

rusackas commented 8 months ago

Can anyone validate whether or not this is still an issue in 3.x or newer versions? We no longer support 2.x, so I'm tempted to close this as stale, but if we can get a working failure case for 3.x using example/sample data, that'd be great.

ProdigyMaster commented 7 months ago

@rusackas The issue remains the same: sorting in pivot tables doesn't work, as it displays data in a random order.

cmcnicoll commented 7 months ago

I'm seeing the same issue in Preset version 2024.8.2. The query that runs is correct, but the pivot table sorts in ascending order for this example:

SELECT DATE_TRUNC('month', order_date) AS order_date,
       state AS state,
       COUNT(*) AS count
FROM public."Vehicle Sales"
GROUP BY DATE_TRUNC('month', order_date),
         state
ORDER BY 1 DESC
LIMIT 10000
lindsay-kk commented 7 months ago

same issue, can we pls have a patch for this in the next updated version

liany-dropit commented 7 months ago

We have the same issue

swami-kf commented 7 months ago

We too have encountered the exact same issue!

image

jamzl commented 6 months ago

Same here!

eliaetzensperger commented 5 months ago

Same here!

rtotheb2000 commented 4 months ago

Same here! Any known workaround?

zlzdmv2022 commented 2 months ago

Same here! Still in 4.0.2

ngocdd commented 2 months ago

same problem here: Version: 4.0.2

kpiforgeoliver commented 3 weeks ago

Have tried 4.0.1 and 4.0.2 still no ability to sort except alphabetic or numeric sorts of the first column. It's quite ridiculous that a chart as basic as a pivot table cannot have a column sort that works.