Oracle9i OLAP Services Developer's Guide to the Oracle OLAP API Release 1 (9.0.1) Part Number A88756-01 |
|
Selecting Data, 3 of 5
Typically, you use one of the following shortcut methods to select one or more elements in a Source
based on its value:
Source.select(BooleanSource)
, Source.selectValue(Source)
, Source.selectValues(Source)
, and Source.selectValues(Source[])
methods.
BooleanSource.selectValue(boolean)
and BooleanSource.selectValues(boolean[])
methods.
NumberSource.selectValue(double)
, NumberSource.selectValue(int)
, NumberSource.selectValue(float)
, and NumberSource.selectValue(short)
methods and the NumberSource.selectValues(double[])
, NumberSource.selectValues(float[])
, NumberSource.selectValues(int[])
, and NumberSource.selectValues(short[])
methods.
StringSource.selectValue(String)
and StringSource.selectValues(String[])
methods.
You can also select elements using the primitive join
method by using the COMPARISON_RULE_SELECT
constant as shown below.
Source Source::join (Source joined, Source comparison, Source.COMPARISON_RULE_SELECT, boolean visible)
Assume that you have a primary Source
objects named timesDim
that you created from an MdmDimension
object named mdmTimesDim
and whose elements are the calendar values.
To select only the those values for 1996, you can issue the following code.
Source timesSel = timesDim.selectValue("1996");
Assume that you have three primary Source
objects named productsDim
, promotionsDim
, channelsDim
, and timesDim
, that you got from MdmDimension
objects and that you have a primary Source
object named sales
that you got from an MdmMeasure
object. The productsDim
, promotionsDim
, channelsDim
, and timesDim
objects do not have any keys (that is, they are not dimensional). The sales Source object is multidimensional. It has productsDim
, promotionsDim
, channelsDim
, and timesDim
as dimensions or keys.
To select all of the products that sold more than $10,000,000 in 1996, you can issue the following code.
Source promotionSel = promotionsDim.selectValue("Promo total"); Source channelSel = channelsDim.selectValue("Channel total"); Source timeSel = timesDim.selectValue("1996"); Source bigSellers = productsDim.select(sales.gt(10000000)). join(promotionSel).join(timeSel).join(channelSel);
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|