Pivot Measures Order Used in Pivot Exports (#49367)
* Pivot Measures Order Used in Pivot Exports Fixes #48442 A pivot table can have any number of measures, and the user can order these by dragging in the UI. Before this PR, that order was ignored and measures would alway be in index order, which is confusing for any user who needs the measures to be displayed in a particular order, especially if they've re-ordered them in the pivot viz settings UI. A test has been added to check that measure order is used. A few minor changes to the pivot qp and post-processor - measure indices are looked up in the pivot qp and added in viz-settings order - the pivot measures are only added if the qp has not already added them. - pivot-opts Malli spec has been made in the namespace, adjusted to allow `nil` as a valid pivot-opts output, and used in relevant functions * address review points. * add a rows order test
Showing
- src/metabase/query_processor/pivot.clj 50 additions, 47 deletionssrc/metabase/query_processor/pivot.clj
- src/metabase/query_processor/pivot/postprocess.clj 13 additions, 4 deletionssrc/metabase/query_processor/pivot/postprocess.clj
- src/metabase/query_processor/streaming/csv.clj 4 additions, 5 deletionssrc/metabase/query_processor/streaming/csv.clj
- src/metabase/query_processor/streaming/json.clj 0 additions, 2 deletionssrc/metabase/query_processor/streaming/json.clj
- test/metabase/api/downloads_exports_test.clj 84 additions, 8 deletionstest/metabase/api/downloads_exports_test.clj
- test/metabase/query_processor/pivot_test.clj 3 additions, 3 deletionstest/metabase/query_processor/pivot_test.clj
Loading
Please register or sign in to comment