Skip Headers
Oracle® OLAP DML Reference
10g Release 2 (10.2)

Part Number B14346-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

STATLAST

The STATLAST function returns the last value in the current status list of a dimension or a dimension surrogate, or in a valueset.

Return Value

The data type returned by STATLAST 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. See "Automatic Data Conversion of Returned Dimension Values".

Syntax

STATLAST(dimension)

Arguments

dimension

A text expression whose value is the name of a dimension, a dimension surrogate, or a valueset.

Notes

Automatic Data Conversion of Returned Dimension Values

The dimension value returned by STATLAST is converted to a number or a text value, as appropriate to the context. Suppose, for example, that jun95 is the sixth month value but the last value in the current status list. The value of STATLAST(month) can be assigned either to a text variable or a numeric variable.

The following statements

DEFINE textvar TEXT
TEXTVAR = statlast(MONTH)
SHOW textvar

produce this output.

Jun95

In contrast, these statements

DEFINE intvar INTEGER
INTVAR = STATLAST(month)
SHOW INTVAR

produce this output.

6

Examples

Example 24-29 Setting Status with STATLAST

The following line from a program uses STATLAST to limit month to the values in the status, beginning with a month that has been stored previously in a variable called onemonth, and ending with the last value in the status.

LIMIT month KEEP onemonth TO STATLAST(month)

STATLAST is used here, rather than a particular month value, so that the limit can work on any status list.