1

Is it possible to disregard the default member while calculating the all member during setting up the cube (in "advanced" setting)?

Example: In a stacked column chart the share of the child elements dont add up to 100 percent.

XML Code :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<schemaFactory revisionNumber="16">
    <schemaDefinition name="testschema" group="Default Group" loadOnStartup="false">
        <activateIncrementalLoad>false</activateIncrementalLoad>
        <useUnknownMembersInFacts>true</useUnknownMembersInFacts>
        <autoCleanUpTableColumns>false</autoCleanUpTableColumns>
        <useFactPartitioning>false</useFactPartitioning>
        <inMemoryDS name="facts">
            <memoryDataTable tableName="facts" rowLimit="-1" id="c1f00fc4-9fcd-41f3-9347-d5362b2b00f0">
                <column name="category" tableType="STRING" type="INTEGER" selected="true" primaryKey="false" nullObjectAsString=""/>
                <column name="value" tableType="STRING" type="INTEGER" selected="true" primaryKey="false" nullObjectAsString=""/>
                <stringDateConverter></stringDateConverter>
                <trimStrings>true</trimStrings>
                <addRowNumber>false</addRowNumber>
                <columnSeparator>,</columnSeparator>
                <commentMarker>#</commentMarker>
                <dataAsString>category,value
1,1
2,2
3,3
4,4
5,5
6,6</dataAsString>
            </memoryDataTable>
            <memoryDataTable tableName="categories" rowLimit="-1" id="3badb961-1101-4db0-96b3-1886f1a27085">
                <column name="id" tableType="STRING" type="INTEGER" selected="true" primaryKey="false" nullObjectAsString=""/>
                <column name="name" tableType="STRING" type="STRING" selected="true" primaryKey="false" nullObjectAsString=""/>
                <stringDateConverter></stringDateConverter>
                <trimStrings>true</trimStrings>
                <addRowNumber>false</addRowNumber>
                <columnSeparator>,</columnSeparator>
                <commentMarker>#</commentMarker>
                <dataAsString>id,name
1,cars
2,tv
3,shoes
4,skirts</dataAsString>
            </memoryDataTable>
        </inMemoryDS>
        <multiLevelDimension dataTableId="3badb961-1101-4db0-96b3-1886f1a27085" isTimeDimension="false" isDefaultTimeDimension="false" isIndexingByRange="false" unknownMemberName="-" id="34648f63-775c-4eb0-b140-0ff85d51c49e" name="categories">
            <multiLevelHierarchy hasAllLevel="true" allLevelName="All-L" allMemberName="All-M" name="categories" isDefault="true">
                <level name="name" nameUnique="true" nameUniqueInParent="false" keyUnique="true" ignoreNameCollision="false">
                    <column name="id"/>
                    <nameCol name="name"/>
                    <orderType>NONE</orderType>
                    <orderKind>ASC</orderKind>
                </level>
            </multiLevelHierarchy>
        </multiLevelDimension>
        <cube id="cce8c81b-384b-4531-8e14-3eff23b7f6c6" name="Cube">
            <defaultFacts measureGroupName="Facts-2" partitioningLevelName="" newGeneration="true" dataTableId="c1f00fc4-9fcd-41f3-9347-d5362b2b00f0" aggregateDataSourceFacts="false" unresolvedRowsBehavior="ERROR">
                <rowFactAggregationType>ADD_ROW</rowFactAggregationType>
                <measure name="value" aggregationType="SUM">
                    <rollupHierarchy></rollupHierarchy>
                    <dataColumn name="value"/>
                    <cellProperties></cellProperties>
                    <emptyIsZero>false</emptyIsZero>
                </measure>
                <links dimensionId="34648f63-775c-4eb0-b140-0ff85d51c49e">
                    <viewLinks type="LAST_LEVEL">
                        <toColumns name="category"/>
                    </viewLinks>
                </links>
            </defaultFacts>
        </cube>
    </schemaDefinition>
</schemaFactory>

4

1 回答 1

1

In MDX the unknown member is a member similar to any other member of a hierarchy, and it's parent is the [All] member.

In your example, the two last rows that sum to 11 defined by the unknonwn member, [categories].[name].[-], are also part of the [All] member. You can see the all as a way saying take all rows, so an MDX All member does not filter anything.

You've a couple of possibilities :

a) You can create a modified category hierarchy that has an intermediate level as Known / Unkown and you define the 'Known'member as the default for this hierarchy.

b) You can create a second hierarchy in the dimension that creates this known/unknown and hide it to a standard user. Here we avoid to modify the main hierarchy.

c) avoid loading 'unknown' rows with a proper SQL statement or a Javascript view.

d) last is to create an Statistical dimension where we define an default that modifies the behaviour of the statements (you've to move to the schema script).

WITH
  CATEGORY HIERARCHY [Stats].[Filter]
  CATEGORY STATIC MEMBER [Stats].[Filter].[All-M].[default] as SubCubeMinus(     [Categories].[categories].[All], [Categories].[categories].[name].[-] )
SELECT [Measures].[value] on 0, [categories].[categories].members on 1 
FROM [Cube]
WHERE [Stats].[Filter].[All-M].[default]

As a remark, having an [All] member that does not behave like an all is in my experience allways a way paving the road for future issues. I'll really go for option c) that is more intuitive, the other ones imply a knowledge of MDX and your model that might not survive you.

于 2017-01-16T16:10:19.650 回答