Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Charts Post Reply Post New Topic
Author Message
Mel B
Newbie
Newbie
Avatar

Joined: 17 Feb 2011
Location: Australia
Online Status: Offline
Posts: 5
Quote Mel B Replybullet Topic: Charts
     Posted: 18 Nov 2013 at 2:15pm
I have added a chart that looks for date of assessment grouped by month for scores on a risk assessment.  Scores are 0 for No Risk, 1 for low risk etc etc
 
Running the report for 3 months Aug, Sept, Oct (sorted in ascending order)
 
Because in September there was no score of zero the chart now goes August, October for zero  and for the next score of 1 goes August, October, September.
 
How can I make it stay in correct ascending order - I can't use specified order as this report will be available for staff to run from now on so I can't specify the order as August 2013, September 2013 etc as this report could be used for the next 5 years?
Melanie Ball
IP IP Logged
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet Posted: 19 Nov 2013 at 5:35am
I'm by no means a CR expert, so someone else may have a better solution, but couldn't you sort by month as a number to avoid alphabetical ordering?

Create a formula field that provides a numeric value for each month,

If {table.month} = "august" then "8" else
If {table.month} = "september" then "9" else
if {table.month} = "October" then "10"

Then group the report on the new formula field instead of the month field.


IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 19 Nov 2013 at 7:24am
I haven't done charts, so I could be completely off my rocker...

as to the ordering, adavis might be correct (I don't know if charts order / display by formula), but I change the values in the if statement to numbers...so that you don't get January, October, November, December, February...

As to missing months...without adding data, that doesn't work.

Also for grouping, you might want to consider something like:
if {table.month}="august" then {table.year} * 100 + 8 else...

this will give something like 201312, 201401 so that multiple years will sort in the correct order as well.

just some thought...hopefully something is useful.
IP IP Logged
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