Chart Sort Order (3 Viewers)

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 12:39
Joined
Feb 5, 2019
Messages
347
Hi All,

I am trying to do a modern chart and want to specify the sort order of the month. But Access in all it's wisdom keeps sorting the months alphabetically, not by number. When I edit the Transformed Row Source, I get an error message stating "You can't assign a value to this object"

1759762046063.png


I have added a field, MonthSequence, which works when the MonthName field is not selected.

1759762119765.png


As soon as I add the MonthName, it fails.

1759762148491.png


On my table, the MonthSequence field is before the MonthName, but this seems to make no difference.

1759762560128.png


I don't suppose anyone has a solution for this? I want to move away from my charts in Excel really.

~Matt
 
No, I was
If I do this, it sorts alphabetically, and not in the correct order :(

~Matt
No, thinking of the monthname() function, so that the order is by month number, but happens to show the name.
I must admit, I have not played with charts much, but that is what I would try, given no other replies ATM.
 
We

Well, please post the solution and not have people have to go looking for it¿
Apologies. The Basics of this is that the chart sort order is the last field in the axis, not the first. So to sort by month number, I have to have this after the month name in the query.

Quite why MS decided this I have no idea, but the 2nd video on the link from Colin said this, so I tried, and it worked.

~Matt
 
Apologies. The Basics of this is that the chart sort order is the last field in the axis, not the first. So to sort by month number, I have to have this after the month name in the query.

Quite why MS decided this I have no idea, but the 2nd video on the link from Colin said this, so I tried, and it worked.

~Matt
Thank you.
 
For info, not only the sort order but the gridline appearance is based on the final series (not the first series)
There is a popup message that tells you this but its easy to miss:

1759771264978.png

Whilst you can enter values for other series, they will normally be overwritten

In this case, I have the x-axis in date order using MMM 'YY format but this was the record order so I did this without sorting

1759771452701.png


If I sort then the values will be sorted ascending/descending and the months-years will be scrambled

The exception to the final series rule is you can set the final series gridlines to major in one colour and the previous series to minor in a different colour, though this can lead to hideous results as deliberately done here.

1759771705069.png


BTW: The transformed row source is read only and set automatically by Access from the row source used for the chart.
 
Last edited:
For info, not only the sort order but the gridline appearance is based on the final series (not the first series)
There is a popup message that tells you this but its easy to miss:

View attachment 121757
Whilst you can enter values for other series, they will normally be overwritten

In this case, I have the x-axis in date order using MMM 'YY format but this was the record order so I did this without sorting

View attachment 121758

If I sort then the values will be sorted ascending/descending and the months-years will be scrambled

The exception to the final series rule is you can set the final series gridlines to major in one colour and the previous series to minor in a different colour, though this can lead to hideous results as deliberately done here.

View attachment 121759

BTW: The transformed row source is read only and set automatically by Access from the row source used for the chart.
Thanks Colin,

I found your page very informative for what I was aiming to do. What I was wondering is, can you base a chart on a crosstab query directly to save the TRANSFORM part?

I am designing a sales dashboard and our company owner wants the graph to display all months in our financial year but display the empty ones with 0. I can make this happen in a crosstab query, but can't seem to get this to work in a chart.

I am tempted to generate a local table for this, but wondered if there was a solution before I do this.

~Matt
 
Not with a modern chart as it always transforms the row source. Why not use the original table/query on which your crosstab is based?
 

Users who are viewing this thread

Back
Top Bottom