<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hello Mondrian team, <br><br>I have recently noticed the following issue with tree hierarchy that is returned by Mondrian. Here is an example: <br><br>This query,&nbsp; SELECT customer_id, country, fullname FROM customer WHERE fullname='Sarah Smith'<br><br>produces following results:<br><br>2588;"USA";"Sarah Smith"<br>4947;"Mexico";"Sarah Smith"<br><br>i.e. there are two "Sarah Smith" entries in the table with country="Mexico" and country="USA". Now consider following schema<br><br>&lt;?xml version="1.0"?&gt;<br>&lt;Schema name="FoodMart"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;Dimension name="HierarchyTest"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Hierarchy hasAll="true" allMemberName="All Customers"
 primaryKey="customer_id"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;View alias="HierarchyTest_view"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SQL dialect="generic"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT * FROM customer WHERE fullname='Sarah Smith'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/SQL&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/View&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Level name="Country"&nbsp;&nbsp; column="country"&nbsp;&nbsp;&nbsp; uniqueMembers="true"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Level name="Name"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; column="fullname"&nbsp;&nbsp;
 uniqueMembers="true"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Level name="Country"&nbsp;&nbsp; column="country"&nbsp;&nbsp;&nbsp; uniqueMembers="true"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Level name="Id"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; column="customer_id"&nbsp;&nbsp;&nbsp; type="Numeric" uniqueMembers="true"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Hierarchy&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/Dimension&gt;<br><br>&nbsp;&nbsp;&nbsp; &lt;Cube name="Sales"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Table name="sales_fact_1997"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;DimensionUsage name="HierarchyTest" source="HierarchyTest"
 foreignKey="customer_id"/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/Cube&gt;<br>&lt;/Schema&gt;<br><br>This will produce the following hierarchy<br><br>All Customers<br>&nbsp;&nbsp;&nbsp; |--Mexico<br>&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; |--Sarah Smith<br><span style="color: rgb(192, 0, 0); font-weight: bold;"><span style="color: black;">&nbsp;&nbsp;&nbsp; |&nbsp;</span>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--Mexico</span><br style="color: rgb(192, 0, 0); font-weight: bold;"><span style="color: rgb(192, 0, 0); font-weight: bold;"><span style="color: black;">&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;</span>&nbsp; &nbsp;&nbsp;&nbsp; |--USA</span><br>&nbsp;&nbsp;&nbsp; |<br>&nbsp;&nbsp;&nbsp; |--USA<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--Sarah Smith<br><span style="color: rgb(192, 0, 0); font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--Mexico</span><br style="color: rgb(192, 0, 0); font-weight: bold;"><span style="color: rgb(192, 0, 0);
 font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--USA</span><br><br>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<br><br>All Customers<br>
&nbsp;&nbsp;&nbsp; |--Mexico<br>
&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; |--Sarah Smith<br>
<span style="color: rgb(192, 0, 0); font-weight: bold;"><span style="color: black;">&nbsp;&nbsp;&nbsp; |&nbsp;</span>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--Mexico</span><span style="color: rgb(192, 0, 0); font-weight: bold;"><span style="color: black;"></span></span><br>
&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp; |--USA<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--Sarah Smith<span style="color: rgb(192, 0, 0); font-weight: bold;"></span><br style="color: rgb(192, 0, 0); font-weight: bold;">
<span style="color: rgb(192, 0, 0); font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--USA</span><br><br><br>Although aggregations work fine I think. It is only an issue with the hierarchy.<br><br>Thanks, <br>~IK<br><br><br></div>
<!-- cg37.c4.mail.gq1.yahoo.com compressed/chunked Sat Jan  9 10:40:06 PST 2010 -->
</div><br>

      </body></html>