Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Chart with MMM-yy order on x-axis Post Reply Post New Topic
Author Message
wibni
Newbie
Newbie


Joined: 16 Apr 2013
Online Status: Offline
Posts: 14
Quote wibni Replybullet Topic: Chart with MMM-yy order on x-axis
    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") ?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
IP IP Logged
wibni
Newbie
Newbie


Joined: 16 Apr 2013
Online Status: Offline
Posts: 14
Quote wibni Replybullet Posted: 11 Jul 2013 at 4:16pm
Perfect. Got it working now.
Thanks!


Edited by wibni - 11 Jul 2013 at 4:16pm
IP IP Logged
wibni
Newbie
Newbie


Joined: 16 Apr 2013
Online Status: Offline
Posts: 14
Quote wibni Replybullet 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?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
IP IP Logged
wibni
Newbie
Newbie


Joined: 16 Apr 2013
Online Status: Offline
Posts: 14
Quote wibni Replybullet 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.


IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.027 seconds.