Problem:
I want to sort my data in chronological order by Month but my data has the Month as a string column.
Issue:
Sorting in a chronological order must use a Datetime field to be properly ordered or it will be organized alphabetically.
Resolution:
By using an Expression you can convert the field from Strings to a Datetime and organize correctly with the same view. If you use the below expression it will convert the data if the string data is in the y1 axis.
if(y1=='January'){'2015-01-01';}
else if(y1=='February'){'2015-02-01';}
else if(y1=='March'){'2015-03-01';}
else if(y1=='April'){'2015-04-01';}
else if(y1=='May'){'2015-05-01';}
else if(y1=='June'){'2015-06-01';}
else if(y1=='July'){'2015-07-01';}
else if(y1=='August'){'2015-08-01';}
else if(y1=='September'){'2015-09-01';}
else if(y1=='October'){'2015-10-01';}
else if(y1=='November'){'2015-11-01';}
else if(y1=='December'){'2015-12-01';}
else{'0';}
Then by using the Formats and Labels in the chart designer, set the view of Default Date Format to MMMM which will display the data in Month name only format.
Comments
0 comments
Please sign in to leave a comment.