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

Formating maximum value

Status
Not open for further replies.

djeddie

IS-IT--Management
Jun 1, 2003
38
AU
Hi All,

Firstly im using Crystal 9.5

Now, in my report, i have staff results where the staff names are actually grouped (so i can summarise their weekly stats).

The staff are then grouped under their supervisores names where again i have summaries for the supervisors.

Not sure if this can be done, but i want to conditionally format the highest value per group.

Heres my example

(Group 1) "Mr Supervisor" (Supervisor)
Calls Answered Calls Made
(Group 2) Staff 1 240 50
Staff 2 190 60
Staff 3 450 15
Staff 4 230 34
Staff 5 150 57

So, what can i do so that the result of "450" is formatted RED because it is the highest value for that group, keeping in mind, each of the staff results are groups and their results are summaries of their stats.

Cheers

please advise if i havent explained well enough.
 
I am assuming that staff 1 thru 5 are detail records.

Right click the field in question and select format field. Click the X-2 next to background color, and enter a formula"

Code:
If {YourField}=Maximum({YourField},{YourGroup}) then yellow else nocolor

If more than one staff member is tied for the top place, then both of these fields will be highlighted.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
You could add a command to the report. Go to database->database expert->add command and enter:

Select table.`supervisor`, table.`employee`, count(table.`calls`) as grpcnt
from `table` table
Group by table.`supervisor`,table.`employee`

Link the command to the table on supervisor and employee. Then go to the section expert->group header->color tab->background->x+2 and enter:

if count({table.calls},{table.employee}) = maximum({command.grpcnt}) then crRed else crNoColor

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top