Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Graph Spanning Multiple Years Post Reply Post New Topic
Author Message
analyst12150
Newbie
Newbie
Avatar

Joined: 30 Dec 2011
Online Status: Offline
Posts: 5
Quote analyst12150 Replybullet Topic: Graph Spanning Multiple Years
    Posted: 30 Dec 2011 at 5:07am
I'm having an issue with the chart function in CR.  I need to plot three lines of data (funding dollars, forecasted dollars, and billed dollars) which span over 12 months and two different years. 
 
The x-axis shows dollar values and the y-axis shows each separate month. Each of the three lines has correlating dollar values for every month. 
 
The problem I can't seem to figure out is that it will only allow me to sort by 1 parameter and not two. Basically, the period of performance I need to graph started in Dec 2011 and goes through Nov 2012. I need the month of Dec. to be the first point on the y-axis, not the last.  All the data is plotting correctly, just not in the right order.
 
I've tried adding both month and year in the "on change of" section, but I keep getting an error message saying I either need one "on change of" parameter and many "show values" or many "on change of" parameters and one "show value". Confused
 
Anyone know if there is a work-around for this?
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 30 Dec 2011 at 5:57am

From the above I'm assuming you have 2 separate columns, month (as a string formatted "mmm") and year.

Create a new formula field;
 
@Formula
date(totext("01" & "-" & {month} & "-" & {year}))
 
on change of @formula.
 
That should work, if I'm mis-understanding you let me know.
 
Regards,
Ryan.
IP IP Logged
analyst12150
Newbie
Newbie
Avatar

Joined: 30 Dec 2011
Online Status: Offline
Posts: 5
Quote analyst12150 Replybullet Posted: 30 Dec 2011 at 6:50am
I have a few columns. The month and year are two separate groups in the report, but are also posted in the details section.
Group 1 is Year, Group 2 is Month
 
Here's how the design view looks (roughly):
 
Group Header 1 - year
Group Header 2 - @month (formatted so the month displays as "01-JAN", "02-FEB", etc.)
Details a - name, month ("mm"), year
Details b - baseline dollars, actual billed, funded dollars
Group Footer 2 - Sum of Baseline Dollars, Sum of Actual Billed, Sum of Funded Dollars
 
The chart is displaying running total fields of: baseline dollars, actual billed, and funded dollars.
 
I tried using your formula using the formula suggestion, but CR didn't like the string type.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 30 Dec 2011 at 7:12am
try formula like
totext(year(date field)) +"-"+ totext(month(date field))
as on change of
IP IP Logged
analyst12150
Newbie
Newbie
Avatar

Joined: 30 Dec 2011
Online Status: Offline
Posts: 5
Quote analyst12150 Replybullet Posted: 03 Jan 2012 at 9:53am
thanks, guys. I was able to use the "totext" formula you provided to get it to work.
much appreciated!!
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.016 seconds.