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

How to create group function to be used for a graph 1

Status
Not open for further replies.

LcdCyn

Programmer
Feb 7, 2002
19
US
I have one of three values calculated at the detail level for each record using a function (CalcPriority)- ("A", "B", "C").
--
I have created a group that needs to calculate higher level priority in function (GroupPriority) based on the following:

if there is at least one CalcPriority=A from details, then GroupPriority=GroupA.

if there is no CalcPriority=A from details *and* there is at least one CalcPriority=B from details, then GroupPriority=GroupB.

if there is no CalcPriority=A from details *and* there is no CalcPriority=B from details, then GroupPriority=GroupC.
---
I want to use GroupPriority in a bar chart as OnChangeOf criteria.

I am having trouble coding GroupPriority to do this.

Help!
 
P.S. I am using Crystal Reports version 10 Profession Editon.
 
The following worked in XI. Create three formulas, one for each condition, like this:

//{@A}:
if {table.calcpriority} = "A" then 1

Then create a formula {@Priority}:

if sum({@A},{table.groupfield}) > 0 then 1 else
if sum({@A},{table.groupfield}) = 0 and
sum({@B},{table.groupfield}) <> 0 then 2 else
if sum({@A},{table.groupfield}) = 0 and
sum({@B},{table.groupfield}) = 0 and
sum{@C},{table.groupfield}) > 0 then 3

Use {@Priority} as your on change of field in the chart.

-LB
 
Thanks. Your resolution worked well for me.



[medal]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top