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

Trying to get the largest summary of groups 1

Status
Not open for further replies.

Doris

MIS
Sep 25, 2000
9
US
I have a report that is grouped by state with a summation of the balances in that state. I am trying to get the state with the largest balance in the footer. I tried using maximum or nthlargest but it won't let me use the summed field. Any suggestions? Thanks
 
create a formula

if previous (record1) > (record2) then (record1) else (record2)
in this way you should be able to capture the largest number in the formula
 
I am confused. I have a detail section that is grouped on the state. I have a total of the "balances" on the group footer. I am trying to find the state with the largest balance. The previous record won't work on a group summary, will it? Thanks
 
Create a formula like this and place it in the group section and suppress it:

whileprintingrecords;
numbervar maxbal;
stringvar state;
if sum({table.bal},{table.state}) > maxbal then (
maxbal := sum({table.bal},{table.state});
state := {table.state}
);

In the report footer, use a formula like this to display the result:

whileprintingrecords;
numbervar maxbal;
stringvar state;
state + ": "+totext(maxbal,2)//2 for two decimals

If your balance is a currency, change the numbervar to currencyvar in both formulas.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top