Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graph Problems

Status
Not open for further replies.

Darrick

Technical User
Aug 28, 2001
77
US
Ok, here is the story. I've got a chart that is based off of a formula in my report. Basically the chart is displaying a agents name and their Connects Per Hour which is a division of a field from my sub report and total number of connects. My problem is that when I divide the time by the connects field on my parent report, it works great. But when I tell the graph to graph that field, I keep getting a division by zero error. Which is weird because I don't get that error while simply displaying the information on my report. However, I put in an If statement to catch the division by zero error.
For example:
If {TimeFromSum} = 0 Then
0
Else {TimeFromSub} / {Connects}

Now the graph only charts 0 for all of my agents. For some reason it thinks that the {TimeFromSub} is always = 0 This however isn't true, in fact this field can never be 0

Please Help,

Darrick
darrick3@yahoo.com

 
I'm not sure this will completely solve your graphing issue, but the "division by zero" error appears when the denominator is zero. Your formula should be:

If {Connects} = 0
Then 0
Else {TimeFromSub}/{Connects}

See if that helps any!
 
Sorry, that is how the formula is already written like that. The information displays correctly on the report, just not in the graph.
 
Has anyone else ever had this problem?
 
Crystal 8, it is a standard bar chart. What other options do you want to know?
 
I realize this is an old thread, but I am having this exact problem currently. Does anyone know why this occurs?

Thanks,
Rebecca
 
List your version of CR and your chart settings (DATA tab). Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
I'm running CR 8.0
Data Tab - I select "Advanced"
Place chart once in the footer
Select "On Change Of" @Create_date_month (formula field that pulls the month value from a date field, this is how I'm grouping my report)
Show Values: @Pct (formula that I use to get the percentage - it works fine and does not error on me when I don't have my graph).

Is that enough info?

Thanks,
rebecca

 
Oh - and I check on "Don't Summarize Values", because all I want to do is use the actual number that is shown on my report...
 
Post the two formulas as well. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
The report is grouped by the following formula:
@Create_Date_Month - Month ({@Create_Date_Full})

Values are based on:
@Pct_Res_1st - found in the above group of the report
If isNull({@TotalDisplay})
then 0 else
if {@TotalDisplay}=0
then 0
else {@AmtRes1stCall}%{@TotalDisplay}

Since I've changed the latter formula, the chart doesn't error, but it doesn't show data either - and I know that the data is there, as it appears in the body of the report.
 
Need the formula for TotalDisplay, I am going to guess that it has variables in it to display a running total. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Here you go:

Name: {@TotalDisplay}
Formula: WhilePrintingRecords;
numberVar Total;

Name: {@RunningTotal}
Formula: WhilePrintingRecords;
numberVar Amount;
Amount := Amount +{@Res1stNYSS};

Name: {@Res1stNYSS}
Formula: if {@TimeDiffOpen_Resolve} < 20 then 0 else
if {@TimeDiffOpen_Resolve} > 20
then 1

Hope this helps...
 
That is what I was afraid of, Total is calculated WhilePrintingRecords. The chart is calculated before these variables are processed, because the chart is calculated before the WhilePrintingRecords step. Do you know why this variable is being done as a running total with variables? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
CR8.0 and CR8.5 process charts at a different point in the processing cycle. In particular Cr8.5 can chart running totals and formulas with variables properly.

You might want to consider an upgrade. Editor and Publisher of Crystal Clear
 
chelseatech,

About the only time I resort to a running total with variables is because I need to summarize something WhilePrinting. If so, the running total will also be while printing and therefore ineligible for the chart.

Just about every running totals with variables that I can think of that would work in chart, could also be done a simpler way with an automatic running total or a regular summary field. Do you run into many of these? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
The worst part of this is, I have to use Running Totals because I have to use shared variables that I'm passing from a sub-report.

What I really need to do is have two calculations - one where I calculate the number of records created in a month, and compare it to the number of records resolved in that month. This means that I'm pulling separate sets of data, essentially. So, I'm doomed to needing 2 different reports and the sub-report model - is there no way to use shared variables in a cross-tab or chart?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top