Oracle9i OLAP Services Developer's Guide to the OLAP DML Release 1 (9.0.1) Part Number A86720-01 |
|
Limiting an Application's View of the Data, 11 of 11
A valueset is an OLAP DML object that contains a list of dimension values for a particular dimension. You use a valueset to save a dimension status list for later use. The values in a valueset can be saved across OLAP Services sessions. When you attach an analytic workspace, each dimension has all of the values in the default status list. You can then limit a dimension to the values stored in the valueset for that dimension. When you first define a valueset, its value is null. After defining a valueset, you use the LIMIT command to assign values from the dimension to the valueset. You can use the LIMIT command with valuesets in many of the ways that you use it with dimensions. For example, you can use the LIMIT command to expand, reduce, and replace values in the list of values of a valueset.
To create a valueset, take the following steps.
This example adds the valueset LINESET to the demonstration analytic workspace. It is dimensioned by LINE and, therefore, it can be limited by the current values of the LINE dimension. The LD command attaches a description to the object.
The following OLAP DML commands produce the output shown below them.
limit line to first 2 status line The current status of LINE is: REVENUE, COGS
The following OLAP DML commands produce the output shown below them.
define lineset valueset line ld Valueset for LINE dimension values limit lineset to line show values(lineset) REVENUE COGS
Once you have defined a valueset, you can use it to limit a dimension with a single LIMIT command.
For example, the following command limits the LINE dimension to the values stored in the LINESET valueset and displays the new status of LINE.
limit line to lineset status line The current status of LINE is: REVENUE, COGS
The following commands limit DISTRICT to the districts in which sportswear sales exceeded $1,000,000 in 1996. The current status list for the DISTRICT dimension is saved in the valueset SPORTS.DISTRICT. Once you have created the valueset, you can limit the DISTRICT dimension to the same values with one LIMIT command.
define sports.district valueset district limit product to 'SPORTSWEAR' limit month to year 'YR96' limit sports.district to total(sales district) gt 1000000 limit district to sports.district
The following OLAP DML command produce the output shown below it.
status district The current status of DISTRICT is: ATLANTA TO DENVER
You can use the LIMIT command to change the values in a valueset. The simplified syntax for using the LIMIT command in this way is shown below:
LIMIT valueset keyword selection
The valueset argument specifies the name of the valueset you want to change.
The keyword that you specify determines how the command affects the values that are currently in the valueset. The following table outlines the use of the keywords.
The selection argument specifies the selection criteria that you want to be used to determine what values to assign to the valueset. In general, you can use the same arguments when you are using the LIMIT command to select values for a valueset that you can use when you use the LIMIT command to limit a dimension.
For the complete syntax of the LIMIT command, see the entry for the command in OLAP DML Reference.
You can use the following commands and functions to identify and retrieve dimension values that are in a valueset.
For more information on these commands and functions, see the entry for the command or function in OLAP DML Reference.
Suppose an analytic workspace contains a valueset called MONTHSET that has the values JAN95, MAY95, and DEC95. You can use the VALUES function to list the values in that valueset.
The following OLAP DML command produces the output shown below it.
show values(monthset) JAN95 MAY95 DEC95
Suppose that you want to retrieve the position of the values in the MONTHSET valueset, rather than retrieve the actual values themselves. To retrieve the position of values, you use the VALUES function with the INTEGER keyword. When you use this keyword, the position numbers are returned instead of the actual dimension values that are included in a valueset. The position numbers that are returned do not represent positions in the valueset; they represent positions in the dimension on which the valueset is based.
The following OLAP DML command produces the output shown below it.
show values(monthset integer) 61 65 72
The value JAN95 is shown as the sixty-first value in the MONTH dimension, MAY95 as the sixty-fifth value, and DEC95 as the seventy-second value, although they are the first, second, and third values in MONTHSET.
|
![]() Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|