Solved

# Chart by Year side by side years in one chart

Posted on 2008-06-20
Medium Priority
403 Views
Hi is it possible to create a report with a chart in it with two years side by side for comparison by month?

e.g.

april 2007 april 2008  may 2007 may 2008  june 2007 june 2008 in a bar chart?

I couldnt figure it out and I figured i would ask.
0
Question by:shockacon
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3
• 2
• 2

LVL 101

Expert Comment

ID: 21835662
Have you checked the sample reports.  In particular the Chart.rpt example.  It has one that shows this year and last year by client.  What you want should be similar.

mlmcc
0

Author Comment

ID: 21835722
Im looking at it.. it has 17 pages on the one im looking but I dont see one that does what you are reffering to.. can you be a little more specific?  which chart?
0

LVL 101

Expert Comment

ID: 21836327
There is a BAR chart.  It is on page 5.  It isn't doing exactly what you are but the idea might be similar.

mlmcc
0

LVL 35

Expert Comment

ID: 21840294
I'm no chart expert, but I think all you need is to group the data by month in that order.  One way to do that would be to create a formula that combines the month and year, in that order, and group on that.  For example:

// mm-yyyy
(Month ({table.datefield}) * 10000) + Year ({table.datefield})

That would give you values like 042007, 042008, 052007, 052008, etc.  Grouping the data for your chart on that formula should give you the order you want.  I think.  Like I said, I'm no expert on charts, but it seems like it should work.

James
0

LVL 35

Accepted Solution

James0628 earned 2000 total points
ID: 21842684
I didn't think about this until later, but grouping on that formula would change the labels on the bottom axis to those values (042007, 042008, etc.), which aren't the best labels.

You could improve them a bit by changing the formula to output a string and adding a "-" or "/", so you get values like 04-2007 or 04/2007.  They'd still sort the same way in the chart.  For example:

// mm-yyyy
CStr (Month ({table.datefield}), "00") + "/" + CStr (Year ({table.datefield}), "0000")

Or, you could output strings like "April 2007", but they wouldn't sort properly unless you went into the Data tab of the Chart Expert and used "specified order" to set a specific order for the months, but you'd have to do that for every month/year combination that would show up in the chart, so it may not be very practical.

James
0

Author Comment

ID: 21857970
James, you the man! this completely worked!! I thought this was impossible.. thanks!

now that youve given me exactly what I wanted I need to figure out how to format it... its hard to read in the sense that they want spaces or padding between the two months etc.

Again thanks A+
0

LVL 35

Expert Comment

ID: 21862874
You're welcome.  I'm glad I could help.

As for the spacing, that could be a problem.  My impression is that you don't have much (any, really) choice there, but I could be wrong.  If you get stuck, you could always post another question about that (assuming that you haven't already).  I'm sure that there are people around here that know a lot more about CR charts than I do.

James
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirementsâ€¦
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearlyâ€¦
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increasedâ€¦
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signalâ€¦
###### Suggested Courses
Course of the Month15 days, 5 hours left to enroll