I am trying to achieve the following with the Java API:
for this purpose I am using the default schema/example GLOBAL from the Oracle OLAP download section.
This is the modified version of the code from the Oracle OLAP Java guide:
MdmCube unitsCube =
(MdmCube)mdmDBSchema.getTopLevelObject("PRICE_CUBE_AWJ");
MdmBaseMeasure mdmUnits =
(MdmBaseMeasure)unitsCube.getMeasure("UNIT_PRICE");
NumberSource units = (NumberSource)mdmUnits.getSource();
MdmPrimaryDimension mdmPRODDim = (MdmPrimaryDimension)mdmDBSchema.getTopLevelObject("PRODUCT_AWJ");
MdmLevelHierarchy mdmPRODHier = (MdmLevelHierarchy)mdmPRODDim.getDefaultHierarchy();
StringSource custHier = (StringSource)mdmPRODHier.getSource();
StringSource prodHier = (StringSource)mdmPRODHier.getSource();
Source famSel =
prodHier.selectValues(new String[] {"PRODUCT_PRIMARY::FAMILY::ACC",
"PRODUCT_PRIMARY::FAMILY::OS"});
Source querySource2 = units.join(timeSel).join(famSel).join(mdmPRODHier.getSource());
The result of the above query is a Cartesian product, and each family is matched with each product hierarchy as:
7: (PRODUCT_PRIMARY::CLASS::HRD--------PRODUCT_PRIMARY::FAMILY::ACC--------CALENDAR_YEAR::YEAR::CY1999--------*35.99375*--------)
8: (PRODUCT_PRIMARY::CLASS::HRD--------PRODUCT_PRIMARY::FAMILY::ACC--------CALENDAR_YEAR::YEAR::CY2000--------*32.9807070707071*--------)
9: (PRODUCT_PRIMARY::CLASS::HRD--------PRODUCT_PRIMARY::FAMILY::ACC--------CALENDAR_YEAR::YEAR::CY2001--------*36.8141666666667*--------)
10: (PRODUCT_PRIMARY::CLASS::HRD--------PRODUCT_PRIMARY::FAMILY::OS--------CALENDAR_YEAR::YEAR::CY1999--------*58.3433333333333*--------)
11: (PRODUCT_PRIMARY::CLASS::HRD--------PRODUCT_PRIMARY::FAMILY::OS--------CALENDAR_YEAR::YEAR::CY2000--------*62.113125*--------)
12: (PRODUCT_PRIMARY::CLASS::HRD--------PRODUCT_PRIMARY::FAMILY::OS--------CALENDAR_YEAR::YEAR::CY2001--------*65.7258333333333*--------)
As we can see here it did a match of the HRD
(Hardware) with ACC
(Accessories) and it has a value, but is should not have, as the ACC
belongs to the class SFT
(Software). See the attached screenshot for reference.
Is there a way to make an exclusion, so that when I join those two sources, only values that are possible are shown, meaning in this case that the ACC
would only be shown under the SFT
class as in the screenshot.
All help is more than welcome,
Thank you.