Print Page | Close Window

Pie chart to display top 5

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5257
Printed Date: 02 May 2024 at 10:49pm


Topic: Pie chart to display top 5
Posted By: dutyfree
Subject: Pie chart to display top 5
Date Posted: 19 Jan 2009 at 7:13am
I am using pie chart to display the top 5 countries based on the values. For this, i created an advanced option where on the change of is country with TopN being 5 including others and show values is Pth pecentile (P=50) of @value percent.
The problem is that the pie chart percentage is showing as 52.2% for a country and the detail information below is showing 39.38% which is calculated based on value / total value * 100. The same formula is used for the pie chart as well.

Is this how its supposed to behave or should it show the correct value on the pie chart? How can i achieve the correct value.

thanks



Replies:
Posted By: DBlank
Date Posted: 19 Jan 2009 at 11:55am
HI Dutyfree,
It sounds like rather than limiting your report to only showing the top5 you are pulling in all the data then limiting the pie chart to the top5, correct?
By doing this the pie chart N giving you the percentages is calculating based on total sums for the top5 only rather than all records like the rest of your report, hence the differences in percentages (but not totals). I can't recall if there is a function within the pie chart to handle this or not. Try checking around in the Chart design to see if that can be handled. I don't have access to my Crystal today so I cannot check to see this right now.
You might have to make formula field to convert all the non-top5 records into a single group and include that in the pie chart to keep your N the same, show the top5 by name with totals/percentages and a 6th item as "Others" with a total and percentage with them.
Just some ideas to consider Approve


Posted By: dutyfree
Date Posted: 20 Jan 2009 at 1:28am
Yes absolutely right. I am pulling in all data and the pie chart is showing the percentages based on top5 but the option of others should take care of the rest of the percentages as per my understanding. I mean this is the whole idea of TOP5 right? Any easier way to do this rather than grouping and all that?

thanks


Posted By: DBlank
Date Posted: 20 Jan 2009 at 8:04am
HI Dutyfree-
OK I checked and there might be a solution for you but I do not know what exactly the report design is or what you must display and how. I'll try to explain here but you may need to play with it based on how you are grouped, totally/summing and display requirements.
Under your Group1 on Countries:
1- use the group sort expert and fill it all in the info as you want based on your sums etc.
2 - click on the "Include Others with the Name" and call it whatever you need to..
You will notice now that you only have 6 groups in GH1, all of your non-type 5 countries have a group called "Others".
If you want to work around this and still need to group them individually add another group on your Country Name as group2. THis will regroup these "Others" into there respective individual countries. You can also suppress the group header1 to avoid showing duplicate names for the top5
GH1 - "Countries" as sort on top5 include others.
GH2 - "Countries"
Details
GF2
GF2 - sum/count for your percentages for your top5 pie chart
Does this make sense?



Print Page | Close Window