[Mondrian] Duplicate child nodes in hierarchy

Ika Krtveli ikakartveli at yahoo.com
Sat Jan 9 14:14:19 EST 2010


Hello Mondrian team, 

I have recently noticed the following issue with tree hierarchy that is returned by Mondrian. Here is an example: 

This query,  SELECT customer_id, country, fullname FROM customer WHERE fullname='Sarah Smith'

produces following results:

2588;"USA";"Sarah Smith"
4947;"Mexico";"Sarah Smith"

i.e. there are two "Sarah Smith" entries in the table with country="Mexico" and country="USA". Now consider following schema

<?xml version="1.0"?>
<Schema name="FoodMart">
    <Dimension name="HierarchyTest">
        <Hierarchy hasAll="true" allMemberName="All Customers" primaryKey="customer_id">
            <View alias="HierarchyTest_view">
                <SQL dialect="generic">
                    SELECT * FROM customer WHERE fullname='Sarah Smith'
                </SQL>
            </View>
            <Level name="Country"   column="country"    uniqueMembers="true"/>
            <Level name="Name"      column="fullname"   uniqueMembers="true"/>
            <Level name="Country"   column="country"    uniqueMembers="true"/>
            <!--
            <Level name="Id"              column="customer_id"    type="Numeric" uniqueMembers="true"/>
            -->
        </Hierarchy>
    </Dimension>

    <Cube name="Sales">
        <Table name="sales_fact_1997"/>
        <DimensionUsage name="HierarchyTest" source="HierarchyTest" foreignKey="customer_id"/>
    </Cube>
</Schema>

This will produce the following hierarchy

All Customers
    |--Mexico
    |    |--Sarah Smith
    |        |--Mexico
    |        |--USA
    |
    |--USA
        |--Sarah Smith
            |--Mexico
            |--USA

sarah smith in Mexico or USA has child nodes both USA and Mexico, which does not seem to be the right behavior under the above pivots. Instead, I would expect to see

All Customers
    |--Mexico
    |    |--Sarah Smith
    |        |--Mexico
    |
    |--USA
        |--Sarah Smith
            |--USA


Although aggregations work fine I think. It is only an issue with the hierarchy.

Thanks, 
~IK


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20100109/3f22c88d/attachment.html 


More information about the Mondrian mailing list