Difference between revisions of "MAXVALUES()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to return the maximum numeric value for a matching series of keys
 
Function to return the maximum numeric value for a matching series of keys
 
  
 
==Syntax==
 
==Syntax==
 
MAXVALUES(<expN> [, <for condition>[, <key expression >]])
 
MAXVALUES(<expN> [, <for condition>[, <key expression >]])
 
  
 
==See Also==
 
==See Also==
[[AVERAGE]], [[AVGVALUES()]], [[AMAX()]], [[AMIN()]], [[CNTVALUES()]], [[COUNT]], [[MAX()]], [[MIN()]], [[MINVALUES()]], [[SQLVALUES()]], [[SUM]], [[SUMVALUES()]], [[ALLVALUES()]]
+
[[ALLVALUES()]], [[AVERAGE]], [[AVGVALUES()]], [[AMAX()]], [[AMIN()]], [[CNTVALUES()]], [[COUNT]], [[MAX()]], [[MIN()]], [[MINVALUES()]], [[SUM]], [[SUMVALUES()]], [[TOTAL]]
, [[TOTAL]]
+
  
 
==Description==
 
==Description==
Line 15: Line 12:
  
 
After completion, all record pointers and indexes are returned to their original positions.
 
After completion, all record pointers and indexes are returned to their original positions.
 
  
 
==Example==
 
==Example==
Line 28: Line 24:
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Revision as of 11:37, 10 February 2012

Purpose

Function to return the maximum numeric value for a matching series of keys

Syntax

MAXVALUES(<expN> [, <for condition>[, <key expression >]])

See Also

ALLVALUES(), AVERAGE, AVGVALUES(), AMAX(), AMIN(), CNTVALUES(), COUNT, MAX(), MIN(), MINVALUES(), SUM, SUMVALUES(), TOTAL

Description

The MAXVALUES() function returns the maximum value of the <expN> for a matching series of keys. The required <expN> parameter must be a column name from a table. If none of the optional parameters is specified, then the maximum value of keys matching the current key is returned. An optional <for condition> can be specified to restrict the rows included in the operation. You can also optionally specify a <key expression> to return the maximum value from instead of the current key.

After completion, all record pointers and indexes are returned to their original positions.

Example

use customer order title
// Maximum value of balance column for the number of records matching the current key
total_balance = maxvalues(balance) 
// Maximum value of balance column for the number of records matching the key "Mr"
m_male = maxvalues(balance, .T., "Mr")
// Maximum value of balance column for the number of records matching the current key with an expiry date < today
m_expired = maxvalues(balance, expiry<date())