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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphing on a formula?

Status
Not open for further replies.

vbit

Programmer
Jul 31, 2001
47
US
I am using CR 8.5.

Trying to create a bar chart based on a formula. I am using the advanced layout option.

My problem is when I try to put a formula (which is in a group footer) in the show values box of the chart expert, it will not show up in the show values box. The formula is a sum of several fields in my report.
 
Hi!
Does the formula appear in the "Available Fields" in the Layout of the graph?
 
Yes, the formula shows up in the "Available Fields" box. The problem is when I try to bring it over to the "Show Values" box. It doesn't show up in the "Show Values" box when I try to bring it over.

Are there any formulas that can't be used in a graph? If so, which ones?
 
Not all formulas can be charted.
Post the formula. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
The formula I am using is as follows:

If Sum({report1;1.max_q_score},{report1;1.user_name}) = 0 Then ' ' Else
ToText(Sum ({report1;1.q_score}, (rpt_report1;1.user_name}) / Sum ({rpt_report1;1.max_q_score}, {rpt_report1;1.user_name}) * 100)

This particular formula is in a group header.
 
Oops, I made a few changes to the formula, and didn't quite get it totally updated.

Here is the updated formula:

If Sum({report1;1.max_q_score},{report1;1.user_name}) = 0 Then ' ' Else
ToText(Sum ({report1;1.q_score}, {report1;1.user_name}) / Sum ({report1;1.max_q_score}, {report1;1.user_name}) * 100)
 
Two problems. One, the formula returns a string. Hard to summarize a string in a chart. However, the main problem is that this formula uses a SUM function, and therefore can't be summarized again for the chart.

Describe what the chart should look like and we can see if there is an alternative approach. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
The report is grouped by customer name. I am trying to create a graph that is based on the above formula, to get the average of some scores for each customer. These scores are in the detail section (of course, grouped by customer). I am creating the report using advanced layout on the chart expert.

Is there a way to create a graph that has already been summed?

Thanks
 
You can't summarize a field that inlcudes a summary, and then chart it. So, we have to use a different approach.

I still do not understand what your chart would look like. How often would it appear, how many bars, what would a bar represent. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
I managed to modify the formula to get it to work for the chart. It is as follows:

(Sum ({report1;1.q_score},{@member}) / Sum ({report1;1.max_q_score},{@member}) * 100)

@member being the customer's first and last name combined.

The whole point of the chart was to display the average score for each customer based on another group. The chart would be displayed the customer average scores for each group. The number of bars would vary, depending the the number of customers for a particular group. The bars would represent average scores.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top