Forum Discussion
matrix table: sort columns in descending order
Hi,
You cannot achieve this reverse sorting directly... here is a workaround:
1. Go to the Edit Query option of the Week dim table.
2. Apply Sort desc on the unique week code column (there must be a unique identifier for each week i.e. in my case I have WeekCode column as 20170101, 20170102, 20170103, 20170104, 20170205, 20170206.... YYYYMMWW where WW is the incremental week number of the year from 1 to 52.
3. Select 'Add Index column' from Add Column menu and provide Starting Index=1 and Increment=1 in the dialog box.
4. Rename column as appropriate.
4. Save Apply and Close the Edit Query
5. Use this Index as 'Sort By Column' wherever required.
I tried this but received the message
Sort by another column
We can't sort the 'Date' column by 'Index'. There can't be more than one value in 'Index' for the same value in 'Date'. Please choose a different column for sorting or update the data in 'Index'.
Based on this error message, I duplicated the 'Date' column and set Data Type: Whole Number. Sorted the 'Date' by this field, with no change. Matrix still displays the oldest week on the left. Any other suggestions?