Difference between revisions of "ALLVALUES()"

From Recital Documentation Wiki
Jump to: navigation, search
(Description)
(Description)
Line 12: Line 12:
 
The ALLVALUES() function returns the results of CNTVALUES(), SUMVALUES(), MINVALUES(), MAXVALUES(), AVGVALUES() and CNTVALUES() for the value of <expN> over a matching series of keys.  The required <expN> parameter should be a numeric expression referencing one or more columns from the current cursor.  If none of the optional parameters is specified, then the keys matching the current key is scanned.  An optional <for condition> can be specified to restrict the rows included in the sum operation.  You can also optionally specify a <key expression> to perform the sum on instead of the current key. An optional <tag name or index order> can be specified also.
 
The ALLVALUES() function returns the results of CNTVALUES(), SUMVALUES(), MINVALUES(), MAXVALUES(), AVGVALUES() and CNTVALUES() for the value of <expN> over a matching series of keys.  The required <expN> parameter should be a numeric expression referencing one or more columns from the current cursor.  If none of the optional parameters is specified, then the keys matching the current key is scanned.  An optional <for condition> can be specified to restrict the rows included in the sum operation.  You can also optionally specify a <key expression> to perform the sum on instead of the current key. An optional <tag name or index order> can be specified also.
  
This function returns a dynamic array containing 5 items; "CNT", 'MAX", "MIN", "AVG", "SUM".  
+
This function returns a dynamic array containing 5 elements which can be referenced as "CNT", 'MAX", "MIN", "AVG", "SUM".  
  
 
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.

Revision as of 04:45, 20 June 2010

Purpose

Function to return all values for a numeric expression against the current cursor for a matching series of keys

Syntax

ALLVALUES(<expN> [[, <for condition> [, <key expression>]] [,<tag name or indexorder>] )

See Also

AVERAGE, COUNT, SUM, TOTAL, AMAX(), AMIN(), AVGVALUES(), CNTVALUES(), MAX(), MAXVALUES(), MIN(), MINVALUES(), SQLVALUES()


Description

The ALLVALUES() function returns the results of CNTVALUES(), SUMVALUES(), MINVALUES(), MAXVALUES(), AVGVALUES() and CNTVALUES() for the value of <expN> over a matching series of keys. The required <expN> parameter should be a numeric expression referencing one or more columns from the current cursor. If none of the optional parameters is specified, then the keys matching the current key is scanned. An optional <for condition> can be specified to restrict the rows included in the sum operation. You can also optionally specify a <key expression> to perform the sum on instead of the current key. An optional <tag name or index order> can be specified also.

This function returns a dynamic array containing 5 elements which can be referenced as "CNT", 'MAX", "MIN", "AVG", "SUM".

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

Example

use customer order title 
m_values = allvalues(balance, .T., "Mr")
echo m_values


Products

Recital, Recital Server