我正在尝试使用 Java API 实现以下目标:
为此,我使用 Oracle OLAP 下载部分中的默认模式/示例 GLOBAL。
这是 Oracle OLAP Java 指南中代码的修改版本:
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());
上述查询的结果是一个笛卡尔积,每个族与每个产品层次结构匹配为:
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*--------)
正如我们在这里看到的,它匹配了HRD
(硬件)和ACC
(附件),它有一个值,但不应该有,因为它ACC
属于类SFT
(软件)。请参阅随附的屏幕截图以供参考。
有没有办法进行排除,这样当我加入这两个来源时,只显示可能的值,这意味着在这种情况下,ACC
只会在SFT
类下显示,如屏幕截图所示。
所有的帮助都非常受欢迎,
谢谢你。