<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>Having a calculated member as default member is a great 
idea.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>There is a problem that when you evaluate a calculated 
member, the context is switched so that the current member becomes the default 
for that dimension.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>For example,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>WITH MEMBER [Measures].[Foo] as ' 
[Measures].CurrentMember.Name '</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>SELECT {[Measures].[Foo] } ON COLUMNS</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>FROM [Sales]</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>will return "Unit Sales".</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>If you define a calculated member as the default member, 
and you forget to switch the context, the expression will loop. For example, if 
you define</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>[Measures].[Foo] as ' ([Time].[1997].[Q2], [Store].[CA] ) 
'</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>and make [Foo] the default measure, it is saying that [Foo] 
for any cell is the value of [Foo] in California, 97Q2, which is a recursive 
defn.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>It is not a terrible problem, but it is a pitfall end-users 
should know about, and you should document in schema.html. You should test for 
it and make sure that the error message is reasonable.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=813303621-12042007><FONT face=Verdana 
color=#000080 size=2>Julian</FONT></SPAN></DIV><FONT face=Verdana color=#000080 
size=2></FONT><FONT face=Verdana color=#000080 size=2></FONT><BR>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> mondrian-bounces@pentaho.org 
  [mailto:mondrian-bounces@pentaho.org] <B>On Behalf Of </B>Shishir 
  Das<BR><B>Sent:</B> Thursday, April 12, 2007 5:28 AM<BR><B>To:</B> 
  mondrian@pentaho.org<BR><B>Subject:</B> [Mondrian] Default measure not 
  configurable in Schema.xml.<BR></FONT><BR></DIV>
  <DIV></DIV><BR><FONT face=sans-serif size=2>Hi,</FONT> <BR><BR><FONT 
  face=sans-serif size=2>We need a functionality by which we can specify a 
  calculated member as a default measure.</FONT> <BR><FONT face=sans-serif 
  size=2>Currently, Mondrian considers the first measure defined in a cube as 
  the default measure, hence a calculated member cannot be default 
  measure.</FONT> <BR><BR><BR><FONT face=sans-serif size=2>Is there an existing 
  way(which we overlooked) to achieve this? Please let us know.</FONT> 
  <BR><BR><FONT face=sans-serif size=2>We could think of a solution 
  where:</FONT> <BR><BR><FONT face=sans-serif size=2>we have a property added to 
  the cube element in Schema.xml to specify the default measure so that all 
  queries use that measure</FONT> <BR><FONT face=sans-serif size=2>as default 
  measure. It will be an optional property. If user does not explicity specify 
  it, the behaviour will be the same as it is now. Do you foresee any issues if 
  we add this property?</FONT> <BR><BR><BR><FONT face=sans-serif 
  size=2>Regards,</FONT> <BR><FONT face=sans-serif 
size=2>Shishir</FONT></BLOCKQUOTE></BODY></HTML>