Oracle9i OLAP Services Developer's Guide to the Oracle OLAP API
Release 1 (9.0.1)

Part Number A88756-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Selecting Data, 3 of 5


Selecting Elements Based on Element Values

How you select elements based on value

Typically, you use one of the following shortcut methods to select one or more elements in a Source based on its value:

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)

Example: Selecting based on element values

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");

Example: Selecting based on key values and element values

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);

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table of Contents
Contents
Go To Index
Index

Master Index

Feedback