i have prepared a report based on the following view:
SELECT EXTRACT(MONTH FROM orders_date),
MONTHNAME(STR_TO_DATE(EXTRACT(MONTH FROM orders_date),‘%m’)) monthnumber,
sum(orders.orders_sigtotal)
FROM orders GROUP BY EXTRACT(YEAR_MONTH FROM orders_date)
order by EXTRACT(MONTH FROM orders_date) asc limit 12
report is displaying fine, like:
1 Jan 200,000
2 Feb 130,000
3 March 400,000
4 April 50,000
but in chart the month values are not sorting out, like:
April Feb January March
Note: i did not selected Chart’s Sort Type option. But even if i select X ASC or X Desc,
it does’nt effect the chart sort, they remains April, Feb, January, March or March, January, February, April.
How could i use Custom Sort Sequence ? What i will right in that column ?
You may enter your own sort sequence (X value should be monthnumber in your view, which is actually monthname, not by the month), see the topic Chart Setup → Custom sort sequence in the help file. (No need to order by EXTRACT(MONTH FROM orders_date) although it doesn’t affect the custom sort.)
From the help file, the first and the third should be correct.
Forget about the third and its error, the first one (which should work as mentioned in the help file) never worked for me, whatever I select in the “Sort type” field.
Forget about the third and its error, the first one (which should work as mentioned in the help file) never worked for me, whatever I select in the “Sort type” field.
Why not the third type? It is actually better. From the source code:
if (is_array($seq))
$ar = $seq;
else
$ar = explode(“,”, $seq);
If it is not already an array, it just explode it to get one. So they are the same, and the third type saves a step.
Make sure:
You choose either X ASC or X DESC
Your custom sort sequence is from the X axis and they must be the same as what you see in the chart (including letter case)
If you use the first type, make sure there is no spaces before or after the comma