Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Charting based on Formula Post Reply Post New Topic
Author Message
shashibadari
Newbie
Newbie


Joined: 25 Jun 2009
Location: United States
Online Status: Offline
Posts: 2
Quote shashibadari Replybullet Topic: Charting based on Formula
     Posted: 25 Jun 2009 at 10:29am
Hi All,
 
I am new to Crystal Reports, i need to chart ( Bar chart) based on a formula field.
 
I have one group - GrpA and a subtotal for that is a formula field which has conditions and calculations in that. Now i need to chart with GrpA Name on X-Axis and the subtotal field on the y-axis.
 
The subtotal field is based on 2 running total fields.
 
Here is the Report View :
 
GrpA : 1
Details: sss     dddd  date1 date2  (date1-date2)
---------------------------------------------------------------
Subtotal:                                           85 %
 
 
Calculation for 85% ( date1-date2 which are > 0) * 100 / (grpA Count)
 
I have used running totals for (date1-date2 whihc are > 0) and grpA count
 
But i am not able to chart based on the % i am calculating, Can someone plz help me.
 
Thanks in Advance
Shashi
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Jun 2009 at 11:30am
Here is one way...
Create a formula field to sum from as "Include" (or whatever):
if date1-date2 >0 then 1 else 0
Create another formula as "percentage" to get your percentage:
if count({table.field},group1)=0 then 0 else
SUM({@Include},group1) % count({table.field},group1)
 
place your chart ion the report header,
select the chart expert as a side-by side bar chart.
In data tab select  on change of as your group1 field, show value as @percentage (make sure don't summarize is checked).
on the Axes you can manually set it for 1-100 as percentage.
 
 
 
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