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

selecting a Column based on Max or Min of other Column

Status
Not open for further replies.

Deepravs

Programmer
May 17, 2010
7
0
0
US
Hi ,

ColumnA ColumnB
A 15
B 45
C 35
D 75
E 55

I need to get Column A based on Max and Min Value of Column B
Here: I need to get the answer as D and A

I could do this using formula or running totals but these only display in either Details, Group Header/Group Footer Sections.

As these values should go between the Text in the report,I need to place these Values in either Report Header/Report Footer.


Thanks,
 
Are you looking for the max/min per the entire report? You can do this by creating a formula for the detail section (suppress it):

whileprintingrecords;
stringvar minx;
stringvar maxx;
if {table.colB} = maximum({table.colB}) then
maxx := {table.colA} else
maxx := maxx;
if {table.colB} = minimum({table.colB}) then
minx := {table.colA} else
minx := minx;

In the report footer use the following:

whileprintingrecords;
stringvar minx;
stringvar maxx;
maxx + " and " +minx

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top