Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Using Pie Charts for data Post Reply Post New Topic
Author Message
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Topic: Using Pie Charts for data
     Posted: 17 Jul 2014 at 3:27am
I am starting to branch out with Crystal by developing some pie charts for metrics. 

One metric I am designing is shows parts that we were able to use from inventory vs what was needed to be ordered for a repair.  I would like to show not only counts and percentages but also the total cost for both groups.   I created a formula to split out items from stock vs ordered items


if
isnull (Table.PONumber)
then
"Inventory"
else
"Order"

This formula is working great.  I am trying to create two formulas to show the separate total cost for the two groups.

Formula 1)
If
@StockvOrder = "Inventory"
then
sum(Table.Cost)

Formula 2)
if
@StockvOrder = "Order"
then
sum(Table.Cost)


When I put these two formulas into the report the "Inventory" shows a number, but the "Order" shows a $0 


Am I  going about this in the right way. and if so why would it do this?  Is there a better solution?

Also, just for the record I am placing my chart in the report header

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Jul 2014 at 3:51am
you want one pie chart per part?
group on part
add your pie chart to the group header
under data add your first 'inventory' else 'order' formula as the 'on change of' field
under show value add the record number set to summarize as count and cost set to summarize as sum
 
In general charts need to do their own sumamrization so your formula 1 and formula 2 are not needed 
 
IP IP Logged
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Posted: 17 Jul 2014 at 5:09am
What I am looking is for is 1 chart with two "slices" of pie.  1 slice to show the number of parts we used from our inventory and the other slice to show the number of parts we had to order. 

In the legend i would like to to see counts for each case, percentage, and cost

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Jul 2014 at 5:21am
do the same thing as suggested in by part but make the chart in the report header
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