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!

Looking For the MAXIMUM Value of several Fields in a table.

Status
Not open for further replies.

CurtR

Programmer
Aug 9, 2000
66
0
0
US
I have a report with 18 Fields Holding Temps. While I can obtain the MAXIMUM of each field with the summary function. I have not been able to find a way to obtain the MAXIMUM of those values.. I am in short trying to find the MAXIMUM Value in the table.
We Are using CR Ver. 7
Thanks
Curt [sig][/sig]
 
Curt,

You need to do an "array" maximum. The array would be your 18 grand totals:

Maximum ([Maximum ({x.f1}), Maximum ({x.f2}),Maximum ({x.f3}), Maximum ({x.f4})...])

Each maximum inside the square brackets represents the maximum of one column of your report. [sig]<p>Ken Hamady<br><a href=mailto:ken@kenhamady.com>ken@kenhamady.com</a><br><a href= Reports Training by Ken Hamady</a><br>[/sig]
 
last message : september 2000... :)

i already use this method to obtain the maximum of several fields, but if ever one field is null, the maximum of the array returns NULL, and the maximum of the array, in which i use this NULL maximum returns NULL too (yes ken it's about my 2400+ formulas/running totals report ;-) )
Is there a way to oblige the report to consider a NULL field as a 0 -so that my maximum of the array will work- ???
Regards,
bob
 
little explanation :
i have 24 hourly averages for a day (24 running totals)
i add them in an array, then take the maximum of this array ; i repeat this for the 31 days of a month (31 formulas)
and, at the end of the month, i add the 31 maximums in an array, and take the maximum...
Of course i have to display every days in 1 form
but, if ever one hour in the month (!!) isn't in the database, i'll get a NULL result !!!

note : this makes 31 * 24 = 744 formulas
note 2 : the number of formulas displayed on the form, in only 1 page, is 31 days * 40 rows = 1240 formulas (font size = 6), plus 20 for end month summaries
 
Bob,

under file, options, reporting tab, check the &quot;convert null field value to default&quot; checkbox. Then the nulls should turn into zeros.

Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top