<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Use </span>uniqueMembers=&quot;false&quot; in the levels below
the first.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Sherman<span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
mondrian-bounces@pentaho.org [mailto:mondrian-bounces@pentaho.org] <b>On Behalf
Of </b>Ika Krtveli<br>
<b>Sent:</b> Sunday, January 10, 2010 6:14 AM<br>
<b>To:</b> mondrian@pentaho.org<br>
<b>Subject:</b> [Mondrian] Duplicate child nodes in hierarchy<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>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;&quot;USA&quot;;&quot;Sarah Smith&quot;<br>
4947;&quot;Mexico&quot;;&quot;Sarah Smith&quot;<br>
<br>
i.e. there are two &quot;Sarah Smith&quot; entries in the table with
country=&quot;Mexico&quot; and country=&quot;USA&quot;. Now consider following
schema<br>
<br>
&lt;?xml version=&quot;1.0&quot;?&gt;<br>
&lt;Schema name=&quot;FoodMart&quot;&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;Dimension name=&quot;HierarchyTest&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Hierarchy
hasAll=&quot;true&quot; allMemberName=&quot;All Customers&quot;
primaryKey=&quot;customer_id&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;View
alias=&quot;HierarchyTest_view&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;SQL dialect=&quot;generic&quot;&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=&quot;Country&quot;&nbsp;&nbsp;
column=&quot;country&quot;&nbsp;&nbsp;&nbsp;
uniqueMembers=&quot;true&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Level
name=&quot;Name&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
column=&quot;fullname&quot;&nbsp;&nbsp; uniqueMembers=&quot;true&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Level
name=&quot;Country&quot;&nbsp;&nbsp; column=&quot;country&quot;&nbsp;&nbsp;&nbsp;
uniqueMembers=&quot;true&quot;/&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=&quot;Id&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
column=&quot;customer_id&quot;&nbsp;&nbsp;&nbsp; type=&quot;Numeric&quot; uniqueMembers=&quot;true&quot;/&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=&quot;Sales&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Table name=&quot;sales_fact_1997&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;DimensionUsage
name=&quot;HierarchyTest&quot; source=&quot;HierarchyTest&quot;
foreignKey=&quot;customer_id&quot;/&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>
<b><span style='color:black'>&nbsp;&nbsp;&nbsp; |&nbsp;</span><span
style='color:#C00000'>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--Mexico<br>
</span><span style='color:black'>&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;</span><span
style='color:#C00000'>&nbsp; &nbsp;&nbsp;&nbsp; |--USA</span></b><br>
&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp; |--USA<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--Sarah Smith<br>
<b><span style='color:#C00000'>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; |--Mexico<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--USA</span></b><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>
<b><span style='color:black'>&nbsp;&nbsp;&nbsp; |&nbsp;</span><span
style='color:#C00000'>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--Mexico</span></b><br>
&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp; |--USA<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--Sarah Smith<b><span style='color:#C00000'><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |--USA</span></b><br>
<br>
<br>
Although aggregations work fine I think. It is only an issue with the
hierarchy.<br>
<br>
Thanks, <br>
~IK<br>
<br>
<o:p></o:p></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>