Print Page | Close Window

Chart with MMM-yy order on x-axis

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19754
Printed Date: 18 May 2024 at 10:43pm


Topic: Chart with MMM-yy order on x-axis
Posted By: wibni
Subject: Chart with MMM-yy order on x-axis
Date Posted: 09 Jul 2013 at 8:05pm
Hi, I'm using Crystal 2010.
I want to show purchase order information for the previous 12 months as of the date the report is run in a line chart.

My on change filed is totext(pwformatdate({POPORH1.DATE}),"MMM-yy") which results in a date format like Jul-13.

In the Chart however, the x-axis is sorted alphabetically, meaning December would come before November and the years are mixed as well.

Is there any way to get the lables right, other than changeing my field to
totext(pwformatdate({POPORH1.DATE}),"yy-MM") ?



Replies:
Posted By: hilfy
Date Posted: 11 Jul 2013 at 11:17am
I haven't tested this, but you might be able to convert all of the dates to the first of the month, use that actual date as the on change field, and then format the date label on the chart to show in MMM-yy format.  To convert to the first of the month, you'll do something like this:
 
Date(Year({POPORH1.DATE}), Month({POPORH1.DATE}), 1)
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: wibni
Date Posted: 11 Jul 2013 at 4:16pm
Perfect. Got it working now.
Thanks!


Posted By: wibni
Date Posted: 11 Jul 2013 at 11:08pm
Would you also know a way of just showing the lable on the x-axis as MMM instead of MMM-yy?


Posted By: hilfy
Date Posted: 12 Jul 2013 at 3:30am
You should be able to format the date to show just the month by doing a custom format and setting the day and year to "none".
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: wibni
Date Posted: 12 Jul 2013 at 9:40pm
Sorry, I don't understand.
Which date do I change to a custom format?
It's not the "on change of" - date, right? As that would just mess with the sorting again I suppose.

If I go to Grid > Group Axis > Numbers, I don't have "custom format" under the categories available.





Print Page | Close Window