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

Calculating minimum and maximum of summary

Status
Not open for further replies.

dev777

Technical User
Dec 8, 2009
24
US
Hi,

I have a grouping report which is grouped by "Req Type" and "Work Order Type" and have summaries like,
Avg Val = Sum({PN.premium})/Count({PN.AcctNumber})

Req Type WO Type Avg Val
A AR 20
B BR 55
C CR 10
D DR 35

Minimum of Avg Val -> ? (Here it should be 10)
Maximum of Avg Val -> ? (Here it should be 55)

I am struggling to get this done..

Thanks
 
You average formulas is not showing the group condition, and your sample data doesn't indicate which group is #1 and which is #2. Assuming the values are at the #2 group level, you could use a formula like this in the Group#2 section:

whileprintingrecords;
numbervar minave;
numbervar maxave;
if groupnumber = 1 then
minave := average({PN.Premium},{table.group#2}) else
if average({PN.Premium},{table.group#2}) < minave then
minave := average({PN.Premium},{table.group#2});
if average({PN.Premium},{table.group#2}) > maxave then
maxave := average({PN.Premium},{table.group#2});

In the report footer, use formulas like these to display the results:

whileprintingrecords;
numbervar minave;

whileprintingrecords;
numbervar maxave;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top