<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><base href="x-msg://2106/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The column order should be well-defined even if there isn't a RETURN clause present. If should be as if there is a RETURN clause for the key &amp; name columns of all attributes of all dimensions. (Or something like that... write a specification that makes sense.)<div><br><div>
<div>Julian</div><br class="Apple-interchange-newline">

</div>
<br><div><div>On Feb 26, 2013, at 7:49 AM, Matt Campbell &lt;<a href="mailto:mcampbell@pentaho.com">mcampbell@pentaho.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Created MONDRIAN-1460 to fix the ordering case when a RETURN clause is present.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">&nbsp;</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">This came up while investigating a failure in lagunitas with testCubesDrillthroughReturnClause9, which does not have a RETURN clause.&nbsp; The test brings back the same results as Mondrian 3x, just in a different order.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">&nbsp;</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">What do you think?&nbsp; I could fix the test by modifying the order in the expected values, or making the test order insensitive (possibly including a check that dimension related attributes are grouped à la SSAS).<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">&nbsp;</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">&nbsp;</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; "><span class="Apple-converted-space">&nbsp;</span><a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a> [mailto:mondrian-<a href="mailto:bounces@pentaho.org">bounces@pentaho.org</a>]<span class="Apple-converted-space">&nbsp;</span><b>On Behalf Of<span class="Apple-converted-space">&nbsp;</span></b>Luc Boudreau<br><b>Sent:</b><span class="Apple-converted-space">&nbsp;</span>Tuesday, February 26, 2013 10:39 AM<br><b>To:</b><span class="Apple-converted-space">&nbsp;</span>Mondrian developer mailing list<br><b>Subject:</b><span class="Apple-converted-space">&nbsp;</span>Re: [Mondrian] Drillthrough column order<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p>&nbsp;</o:p></div><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">When the return clause is omitted, SSAS does not return the rows in any particular order, except that it will group the columns by groups of keys. ie, the following MDX:<o:p></o:p></p><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><strong>DRILLTHROUGH<o:p></o:p></strong></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><strong>SELECT<o:p></o:p></strong></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><strong>&nbsp;&nbsp; { [Measures].[Store Sales]} on AXIS (0),<o:p></o:p></strong></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><strong>&nbsp;&nbsp; { [Product].[Food].[Frozen Foods]} on AXIS (1),<o:p></o:p></strong></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><strong>&nbsp;&nbsp; { [Time].[Year].[1997] } on AXIS (2)<o:p></o:p></strong></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><strong>FROM <o:p></o:p></strong></pre><pre style="margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><strong>&nbsp;&nbsp;&nbsp;[SALES]</strong><o:p></o:p></pre><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">...returns store_sales, store_name, store_city, store_state, store_country, the_date, and so on. Notice that the store-related columns are together.<br><br>When the RETURN clause is used, we should definitely return the columns in that order.<br><br>Luc<br><br><o:p></o:p></p><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">On Tue, Feb 26, 2013 at 10:15 AM, Matt Campbell &lt;<a href="mailto:mcampbell@pentaho.com" target="_blank" style="color: purple; text-decoration: underline; ">mcampbell@pentaho.com</a>&gt; wrote:<o:p></o:p></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">Is there a “correct” order that drillthrough columns should come back in?&nbsp; Currently they come back somewhat arbitrarily in the order they appear in the constrained column bitkey.<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">&nbsp;<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">If a RETURN statement is present it could be argued they should appear in exactly the order in the RETURN.&nbsp; E.g. City should come before month in the query below.&nbsp; Analysis Services appears to honor that ordering, but Mondrian does not.&nbsp; With no RETURN statement, though, it’s not clear whether there should be any specific order expected.<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">&nbsp;<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9.5pt; font-family: Consolas; color: blue; ">DRILLTHROUGH</span><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9.5pt; font-family: Consolas; ">&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span><span style="color: blue; ">SELECT</span><span class="Apple-converted-space">&nbsp;</span>{[Measures].[Unit Sales]}<span class="Apple-converted-space">&nbsp;</span><span style="color: blue; ">on</span><span class="Apple-converted-space">&nbsp;</span><span style="color: blue; ">columns</span></span><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9.5pt; font-family: Consolas; ">&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span><span style="color: blue; ">from</span><span class="Apple-converted-space">&nbsp;</span>[Sales]</span><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9.5pt; font-family: Consolas; ">&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span><span style="color: blue; ">where</span><span class="Apple-converted-space">&nbsp;</span>([Promotions].[One Day Sale],</span><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9.5pt; font-family: Consolas; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Store].[Store City].[Walla Walla],</span><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9.5pt; font-family: Consolas; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Product].[Product Category].[Bread])</span><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9.5pt; font-family: Consolas; color: blue; ">RETURN</span><span style="font-size: 9.5pt; font-family: Consolas; ">&nbsp;</span><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9.5pt; font-family: Consolas; ">[Customers].[City],[Time].[Month]</span><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9.5pt; font-family: Consolas; ">&nbsp;</span><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">&nbsp;<o:p></o:p></div></div><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><br>_______________________________________________<br>Mondrian mailing list<br><a href="mailto:Mondrian@pentaho.org" style="color: purple; text-decoration: underline; ">Mondrian@pentaho.org</a><br><a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank" style="color: purple; text-decoration: underline; ">http://lists.pentaho.org/mailman/listinfo/mondrian</a><o:p></o:p></p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p>&nbsp;</o:p></div></div>_______________________________________________<br>Mondrian mailing list<br><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>http://lists.pentaho.org/mailman/listinfo/mondrian</div></blockquote></div><br></div></body></html>