<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Julian,<br>
<br>
I agree with you that we should start from a good design and then look
at the implementation feasibility. <br>
<br>
The proposal documented earlier <a
 href="http://pub.eigenbase.org/wiki/MondrianOrderFunctionExtension#Use_a_New_Function_Name_-_OrderSet">here</a>
is actually the result of verifying a few other suggestions with
Mondrian implementation. Probably because of this, the proposal has the
appearance of  having originated from implementation. <br>
A compound sort key returned by the member property(e.g.
"[Dim].currentMember.SortKey") can be made to work here. I will take a
look and fill in the details in the wiki page.<br>
<br>
Rushan<br>
<br>
Julian Hyde wrote:
<blockquote cite="mid:1225497469.7754.34.camel@mackerel" type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="GENERATOR" content="GtkHTML/3.18.3">
On Fri, 2008-10-31 at 15:50 -0700, Rushan Chen wrote:
  <blockquote type="CITE">
    <pre>Hi Julian,

I see your suggestions regarding using a set of values along the 
hierarchy to compare member hierarchically. It will solve the DESC/ASC 
issue so that client does not need to enumerate the keys from parent levels.

However, I think this still does not address the issue of supporting 
existing member comparison semantics (see FunUtil.compareSiblingMembers()):

(1) Calculated members collate greater than stored members; 
non-determined if compared with another calculated member.
(2) If two members do not have order key value, compare by ordinals and 
if they are the same, compare by member unique name.

To support the above for a set of members from a single level dimension, 
should the ordinal returned be a compound also? The compound will need 
to include information on : (1) calculated vs non,  (2) order key or 
ordinal,  (3) member unique name.

Please let me know if discussing this offline is more efficient.
    </pre>
  </blockquote>
  <pre>
  </pre>
Rushan,<br>
  <br>
We're at odds because we're coming at this from two different
directions. I'm trying to establish whether Order(&lt;list expr&gt;,
{&lt;sort expr&gt;, &lt;flag&gt;}...) is capable of expressing any form
of sort we need. And you're trying to establish that it can be
implemented efficiently.<br>
  <br>
Obviously I don't want to saddle us with a specification that is
impossible to implement efficiently - or impossible to implement
period. But also I don't want to make the MDX language more complicated
for the end-user because we are driven by how things are working
internally.<br>
  <br>
I haven't heard any cases that Order can't handle - when combined with
.Order_key and .Ordinal. But you point out some complexities of the
implementation that I hadn't thought of.<br>
  <br>
I think the implementation details can be worked out. As you point out,
if we explicitly instantiate this compound value, we would need to
include whether it is calculated, the ordinal, and the unique member
name in order to make the logic work. We probably wouldn't instantiate
this compound value explicitly: we would return a Comparable object
which has a 'Comparable getParent()' method which creates the next
object if the previous comparison has yielded 0. Or, we could recognise
patterns like Order(&lt;set&gt;,
&lt;dimension&gt;.CurrentMember.Order_Key) and Order(&lt;set&gt;,
&lt;dimension&gt;.CurrentMember.Ordinal) and translate them into code
that never actually calls Ordinal or Order_Key at all - code in fact
very similar to the code you have already written.<br>
  <br>
Do you think that any of those implementations could be made to work?
  <pre>Julian
  </pre>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Mondrian mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>
<a class="moz-txt-link-freetext" href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a>
  </pre>
</blockquote>
<br>
</body>
</html>