Oracle® OLAP DML Reference 10g Release 1 (10.1) Part Number B10339-02 |
|
|
View PDF |
The STATFIRST function returns the first value in the current status list of a dimension or a dimension surrogate, or in a valueset.
Return Value
The data type returned by STATFIRST is either the data type of the dimension or dimension surrogate value or an integer that indicates its position in the default status list of the dimension.The dimension value returned by STATFIRST is converted to a number or a text value, as appropriate to the context. See Example 22-26, "Assigning value of STATFIRST to Variables of Different Types".
Syntax
STATFIRST(dimension)
Arguments
A text expression whose value is the name of a dimension, a dimension surrogate, or a valueset.
Examples
Example 22-26 Assigning value of STATFIRST to Variables of Different Types
The following statements
DEFINE textvar TEXT textvar = STATFIRST(month) SHOW textvar
produce this output.
Jun95
In contrast, these statements
DEFINE intvar INTEGER intvar = STATFIRST(month) SHOW INTVAR
produce this output.
6
Example 22-27 STATFIRST with KEEP
The following line from a program uses STATFIRST to limit month
to all values in the status up to a value that has been stored previously in a variable called onemonth
. The keyword KEEP means the new status is always a subset of the old status.
LIMIT month KEEP STATFIRST(month) TO onemonth
STATFIRST is used here, rather than a particular month
value, so that the limit can work on any status list.