Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: CR9 novice stuck on a chart - please help Post Reply Post New Topic
Author Message
tdaplyn
Newbie
Newbie
Avatar

Joined: 18 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote tdaplyn Replybullet Topic: CR9 novice stuck on a chart - please help
    Posted: 18 Jun 2008 at 9:14am
Hi,
I'm new to the whole CR/Reporting domain although I have many year's experience in SQL. I'm just about getting the hang of it all and beginning to trust that CR data engine is doing what I expect (trust issues after being so used to working with SQL directly).
 
However I'm stuck trying to produce a particular chart. It's easy in Excel so I'm sure it can be done..
 
Easiest explained by example:
Sample Data:
 
Gender PizzaScore ItalianScore SushiScore
M 1 5 8
M 2 2 5
F 7 5 6
M 8 2 2
F 2 4 4
F 7 2 9
F 1 9 4
M 5 7 1
F 8 3 2
F 9 2 6
M 4 9 7
M 3 8 8
F 2 3 7
M 8 5 4
 
The chart I want:
 
I can obviously group on Gender, and can calculate summary averages for each of the 3 columns but I can't figure out how to get the column averages on the x-axis. Crystal wants Gender to be on the x-axis. Any ideas?
 
Thanks!
 
Thanks,
Tim
IP IP Logged
tdaplyn
Newbie
Newbie
Avatar

Joined: 18 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote tdaplyn Replybullet Posted: 20 Jun 2008 at 3:06am
No-one got any ideas? I've still not figured it out after much playing. It's driving me a bit nuts that I can't seem to express what I want.
My next attempt is going to be to try to do something horrific in SQL to try to massage the data into the orientation that Crystal seems to need. I'm a bit dissappointed with Crystal if I'm honest, but perhaps I just haven't 'got it' yet.
Advice appreciated.
Thanks,
Tim
IP IP Logged
tdaplyn
Newbie
Newbie
Avatar

Joined: 18 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote tdaplyn Replybullet Posted: 20 Jun 2008 at 3:52am
Doing some more searches (having found the correct terminology to use) it appears that some versions of crystal reports have a chart option "swap series and groups" which should do the job.
Unfortunately for me that option does not seem to exist in CR9 so I'm still stuck.
It seems to be a common problem to which no-one has posted an answer and I simply can't believe that CR can't do something so basic... there must be a way (I hope)...


Edited by tdaplyn - 20 Jun 2008 at 3:53am
Thanks,
Tim
IP IP Logged
tdaplyn
Newbie
Newbie
Avatar

Joined: 18 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote tdaplyn Replybullet Posted: 20 Jun 2008 at 2:01pm
My own solution (better may exist)...
The more I use Crystal, the more I like Excel.
 
Well, being happier with SQL than I am with CR at the moment I went back to what I know best and did the job in a SQL command (below for ref).
 
N.B. PIVOT is a SQL2k5 keyword I believe but similar can be achieved with Aggregate/Case statements.
 

SELECT 'Pizza' as Category, avg(cast(M as float)) as M, avg(cast(F as float)) as F
FROM takeout
PIVOT
( AVG(PizzaScore) FOR Gender IN(M, F)
) AS p
UNION
SELECT 'Italian', avg(cast(M as float)), avg(cast(F as float))
FROM takeout
PIVOT
( AVG(ItalianScore) FOR Gender IN(M, F)
) AS p
UNION
SELECT 'Sushi', avg(cast(M as float)), avg(cast(F as float))
FROM takeout
PIVOT
( AVG(SushiScore) FOR Gender IN(M, F)
) AS p

Produces the following output:

Italian 5.42857142857143 4
Pizza 4.42857142857143 5.14285714285714
Sushi 5 5.42857142857143
 
Which even the ludicrously dim CR charting engine can turn into what I want.
Thanks,
Tim
IP IP Logged
horizon
Newbie
Newbie


Joined: 05 Aug 2008
Online Status: Offline
Posts: 6
Quote horizon Replybullet Posted: 15 Aug 2008 at 3:32pm
Hi TIm, hey i need this display of chart that u have displayed in ur post- 2 bar graphs side by side- how did u do that in crystal?
 
I di not find it in any of the char options. Can you pls help? Also I am displaying similar for change of months
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 15 Aug 2008 at 4:05pm

The bar chart plots as many fields as you tell it to. So if you only added one field to the chart expert, then it will only plot one field. Add another field and you should see it listed in the format shown above.

Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
horizon
Newbie
Newbie


Joined: 05 Aug 2008
Online Status: Offline
Posts: 6
Quote horizon Replybullet Posted: 15 Aug 2008 at 10:24pm
I have 2 formulas 1)Ontime to count the records on tiem and 2 is late records-- so in the chart I put int he On change of Project and in show values - count of ontime and count of late, both the bar graps come at a distance not touching as u have shown in the figure.
 
also in another graph i have on the x axis month fields which i am generating by formula and formulas to calucalte open and new records- so the formula is if record.new = o then "New" and putting this formulas in thechart- summarized tab-- but somehow the count showing on the graphs is all wrong.. is it that crystal while looping through each of the records loses count. am not able to understand. can u provide any help here?
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.063 seconds.