ALLVALUES()

From Recital Documentation Wiki
Revision as of 04:40, 20 June 2010 by Barrymavin (Talk | contribs)

Jump to: navigation, search

Purpose

Function to return all values for an 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 columna from the current workarea (or 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".

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