Search code examples
ms-accessms-access-2016

How do you sort a bar chart using sort order from another column?


I have a column clustered chart which is based on a query that returns 3 columns. These are Rating, SortOrder and Value. My chart uses Rating as Category and Value on the Y axis. However I want to sort the category based on the SortOrder column. So it should have Cash, AA+, AA etc. Currently Access is sorting in alphabetical order.

Resultset showing desired sort order

Chart short alphabetical sort order


Solution

  • Concatenate fields so SrtOrdr value is a prefix to Rating value. Since "Not Rated" has 5 digits, the prefix must have 5 characters with filler zeros.

    Format(SrtOdr, "00000 : ") & Rating

    Use that calculated field for the X-axis.