Skip Headers
Oracle® OLAP DML Reference
11g Release 2 (11.2)

Part Number E17122-07
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
PDF · Mobi · ePub
OLADM674

STATMAX

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

Return Value

The data type returned by STATMAX 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 or surrogate. See "Automatic Conversion of Values Returned by STATMAX".

Syntax

STATMAX(dimension)

Parameters

dimension

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

Usage Notes

OLADM1925Automatic Conversion of Values Returned by STATMAX

The value that STATMAX returns is converted to a number or a text value as appropriate to the context. For example, suppose that the status of month is limited to Jun95 to Dec95 and that Dec95 is the twelfth month in the default status list. The value of STATMAX(month) can be assigned either to a text variable or a numeric variable.

The following statements

DEFINE textvar TEXT
textvar = STATMAX(month)
SHOW textvar

produce this output.

Dec95

In contrast, these statements

DEFINE intvar INTEGER
intvar = STATMAX(month)
SHOW intvar

produce this output.

12

Examples

OLADM1926Example 8-113 STATMAX Used in a Title

The following statements from a program use STATMAX to determine the latest of the 10 months with the highest total sales.

LIMIT month TO BOTTOM 10 BASEDON TOTAL(sales, month)
SHOW JOINCHARS(STATMAX(month) ' is the latest month -
  of the ten months with the lowest sales.')
SHOW JOINCHARS('the months range from ' STATMIN(month) ' to '-  
  STATMAX(month)) 

These statements produce the following sales report.

Dec96 is the latest month of the ten months with the lowest sales.
The months range from Jan95 to Dec96

When you used STATLAST instead of STATMAX, you could have produced a different value, because the LIMIT command arranged the month values by increasing sales rather than chronologically.

Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF