如何在icCube中加载和处理上层维度的文本数据?

How to load and process text data on upper-levels of a dimension in icCube?

我想在 icCube 的自然层次结构中的任何成员上加载文本数据,但我无法使用 MDX 显示上层的文本值。

考虑以下(自然)层次结构、数据和预期结果:

(可能看起来有点奇怪,但 icCube 允许 SUB013 和 SUB014 的叶子为空。)

正如您在上图中所期望的结果中看到的,我希望 "voila" 显示在 SUB015 上。

但是,我无法让它工作。看看我用 MDX 得到的结果:

我有以下问题:

  1. 该值为空(我在文本上使用了无聚合类型)
  2. 另一个观察结果是,对于非聚合类型,金额也是空的

这是否可以通过某种方式解决?

(作为片段附上 - 不可运行 - 我使用的架构,您可以将其上传到您的 icCube 实例中)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<schemaFactory revisionNumber="77">
    <schemaDefinition name="text on sub-total" description="" group="Research" loadOnStartup="false">
        <activateIncrementalLoad>false</activateIncrementalLoad>
        <useUnknownMembersInFacts>false</useUnknownMembersInFacts>
        <autoCleanUpTableColumns>false</autoCleanUpTableColumns>
        <useFactPartitioning>false</useFactPartitioning>
        <callGarbageCollector>NONE</callGarbageCollector>
        <backup>NONE</backup>
        <nonEmptyCachePolicy>NONE</nonEmptyCachePolicy>
        <nonEmptyCacheType>REGULAR</nonEmptyCacheType>
        <nonEmptyCachePersistency>MEMORY</nonEmptyCachePersistency>
        <storagePolicy>DEFAULT</storagePolicy>
        <hierarchyUniqueNameStyle>IncludeDimensionName</hierarchyUniqueNameStyle>
        <inMemoryDS name="manual">
            <memoryDataTable tableName="data" rowLimit="-1" id="3c476e37-708d-4066-831c-89508134beb7">
                <column name="dim" tableType="STRING" type="STRING" selected="true" primaryKey="false" nullObjectAsString=""/>
                <column name="costs" tableType="STRING" type="DOUBLE" selected="true" primaryKey="false" nullObjectAsString=""/>
                <column name="text" tableType="STRING" type="STRING" selected="true" primaryKey="false" nullObjectAsString=""/>
                <addRowNumber>false</addRowNumber>
                <stringDateConverter></stringDateConverter>
                <trimStrings>true</trimStrings>
                <columnSeparator>\t</columnSeparator>
                <commentMarker>#</commentMarker>
                <dataAsString>dim costs text
CHILD001  
CHILD002  
CHILD003 10 hi
CHILD004  
CHILD005  
SUB013 59 salut
SUB014 69 bonjour
SUB015 180 voila
</dataAsString>
            </memoryDataTable>
            <memoryDataTable tableName="dim" rowLimit="-1" id="373a4b14-5b7d-441d-91c0-caabeb670936">
                <column name="SubTotal" tableType="STRING" type="STRING" selected="true" primaryKey="false" nullObjectAsString=""/>
                <column name="Leaf" tableType="STRING" type="STRING" selected="true" primaryKey="false" nullObjectAsString=""/>
                <addRowNumber>false</addRowNumber>
                <stringDateConverter></stringDateConverter>
                <trimStrings>true</trimStrings>
                <columnSeparator>\t</columnSeparator>
                <commentMarker>#</commentMarker>
                <dataAsString>SubTotal Leaf
SUB013 
SUB014 
SUB015 CHILD001
SUB015 CHILD002
SUB015 CHILD003
SUB015 CHILD004
SUB015 CHILD005
</dataAsString>
            </memoryDataTable>
        </inMemoryDS>
        <multiLevelDimension dataTableId="373a4b14-5b7d-441d-91c0-caabeb670936" isTimeDimension="false" isDefaultTimeDimension="false" isIndexingByRange="false" unknownMemberName="" id="6b08783b-b33c-4499-b253-212753be23fd" name="Dim">
            <multiLevelHierarchy hasAllLevel="true" allLevelName="All-L" allMemberName="All-M" name="Dim" isDefault="true" defaultMemberName="">
                <factAggregationType>MEMBER_AND_ANCESTORS</factAggregationType>
                <level name="subtotal" nameUnique="true" nameUniqueInParent="false" keyUnique="true" ignoreNameCollision="false">
                    <column name="SubTotal"/>
                    <nameCol name="SubTotal"/>
                    <orderType>NONE</orderType>
                    <orderKind>ASC</orderKind>
                </level>
                <level name="leaf" nameUnique="true" nameUniqueInParent="false" keyUnique="true" ignoreNameCollision="false">
                    <column name="Leaf"/>
                    <nameCol name="Leaf"/>
                    <orderType>NONE</orderType>
                    <orderKind>ASC</orderKind>
                </level>
            </multiLevelHierarchy>
        </multiLevelDimension>
        <cube id="1c361ef2-ebba-475f-9cc8-83910e4530e2" name="data" description="">
            <defaultFacts measureGroupName="Facts" partitioningLevelName="" partitioningType="NONE" newGeneration="true" dataTableId="3c476e37-708d-4066-831c-89508134beb7" aggregateDataSourceFacts="false" unresolvedRowsBehavior="ERROR">
                <rowFactAggregationType>ADD_ROW</rowFactAggregationType>
                <measure name="costs sum" aggregationType="SUM">
                    <rollupHierarchy></rollupHierarchy>
                    <dataColumn name="costs"/>
                    <cellProperties></cellProperties>
                    <emptyIsZero>false</emptyIsZero>
                </measure>
                <measure name="costs max" aggregationType="MAX">
                    <rollupHierarchy></rollupHierarchy>
                    <dataColumn name="costs"/>
                    <cellProperties></cellProperties>
                    <emptyIsZero>false</emptyIsZero>
                </measure>
                <measure name="costs no agg" aggregationType="NONE">
                    <rollupHierarchy></rollupHierarchy>
                    <dataColumn name="costs"/>
                    <cellProperties></cellProperties>
                    <emptyIsZero>false</emptyIsZero>
                </measure>
                <measure name="text max" aggregationType="MAX">
                    <rollupHierarchy></rollupHierarchy>
                    <dataColumn name="text"/>
                    <cellProperties></cellProperties>
                    <emptyIsZero>false</emptyIsZero>
                </measure>
                <measure name="text no agg" aggregationType="NONE">
                    <rollupHierarchy></rollupHierarchy>
                    <dataColumn name="text"/>
                    <cellProperties></cellProperties>
                    <emptyIsZero>false</emptyIsZero>
                </measure>
                <links dimensionId="6b08783b-b33c-4499-b253-212753be23fd">
                    <viewLinks type="ALL_LEVELS">
                        <toColumns name="dim"/>
                    </viewLinks>
                </links>
            </defaultFacts>
        </cube>
        <localization enabled="false"/>
        <script>
            <content>
            </content>
        </script>
    </schemaDefinition>
</schemaFactory>

在 icCube 中,一个节点值,即使是叶节点,也可以是多个事实行的聚合结果。当您指定 NO_AGGREGATION 作为聚合方法时,如果多个行在播放,则返回 NULL。

例如,SUB015 有一个 child,值为 CHILD003。并且维度定义为 'Fact Aggr. Type' 为 'Members and Ancestors'。

两种解决方案:

1) 添加使用计算成员检索的维度成员 属性。

2) 使用 'Fact Aggr. Type' 作为 'Members' 的维度,但你会得到错误的成本。