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!

Finding Maximun of Summary Field

Status
Not open for further replies.

sexydog

Programmer
Jul 9, 2002
176
GB
Hi

I am using crystal 9. in my report i have 2 groups called products and date, i also have total commission for each product per day.

What i want is the maximum total for commissions.

eg:

Date Products commissions
2003/01/01 A 100
2003/01/01 b 200
total commission = 300


Date Products commissions
2003/01/02 A 100
2003/01/02 b 50
total commission = 150


Maximum Total Commission = 300

How do i get the maximum of a summary field?

Thanks
DJ

 
Create a formula such as:

whileprintingrecords;
numbervar MaxComm;
If Maxcomm < max({table.field,{table.products}) then
Maxcomm := max({table.field,{table.products});

Then later you can display the MaxComm:

whileprintingrecords;
numbervar MaxComm;
MaxComm

I made assumptions here about grouping and how you're constructing the maximum as you didn't supply enough technical information. You may have to tweak it a bit.

-k
 
HI

Thanks it works well. .....But how do i set Maxcomm to zero everytime the group changes.


Thanks
DJ
 
Hi.

You can create another formula field which you place in the group header:

whileprintingrecords;
numbervar MaxComm;
MaxComm := 0

/Goran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top