<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18813"></HEAD>
<BODY>
<DIV><SPAN class=560363321-07092009><FONT color=#000080 size=2 
face="Lucida Sans">There are a few examples in the test 
suite:</FONT></SPAN></DIV>
<UL>
  <LI><SPAN class=560363321-07092009><A 
  href="http://p4webhost.eigenbase.org:8080/open/mondrian/testsrc/main/mondrian/olap/fun/FunctionTest.java">http://p4webhost.eigenbase.org:8080/open/mondrian/testsrc/main/mondrian/olap/fun/FunctionTest.java</A></SPAN></LI>
  <LI><SPAN class=560363321-07092009><A 
  href="http://p4webhost.eigenbase.org:8080/open/mondrian/testsrc/main/mondrian/olap/fun/VisualTotalsTest.java">http://p4webhost.eigenbase.org:8080/open/mondrian/testsrc/main/mondrian/olap/fun/VisualTotalsTest.java</A></SPAN></LI></UL>
<DIV><SPAN class=560363321-07092009><FONT color=#000080 size=2 
face="Lucida Sans">Julian</FONT></SPAN></DIV>
<DIV><U><FONT color=#0066cc></FONT></U><BR>&nbsp;</DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000080 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
  <DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
  <HR tabIndex=-1>
  <FONT size=2 face=Tahoma><B>From:</B> mondrian-bounces@pentaho.org 
  [mailto:mondrian-bounces@pentaho.org] <B>On Behalf Of </B>Rui 
  Gonçalves<BR><B>Sent:</B> Monday, September 07, 2009 7:57 AM<BR><B>To:</B> 
  tom@wamonline.org.uk; Mondrian developer mailing list<BR><B>Subject:</B> Re: 
  [Mondrian] Total for hierarquie levels<BR></FONT><BR></DIV>
  <DIV></DIV>Hi,<BR><BR>Can't seem to be able to use VisualTotals. Can you 
  provide a sample?<BR>Thank's<BR>Rui<BR><BR>
  <DIV class=gmail_quote>On Mon, Sep 7, 2009 at 2:24 PM, <SPAN dir=ltr>&lt;<A 
  href="mailto:tom@wamonline.org.uk">tom@wamonline.org.uk</A>&gt;</SPAN> 
  wrote:<BR>
  <BLOCKQUOTE 
  style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" 
  class=gmail_quote><BR><A 
    href="http://msdn.microsoft.com/en-us/library/ms145527.aspx" 
    target=_blank>http://msdn.microsoft.com/en-us/library/ms145527.aspx</A><BR><BR>VisualTotals 
    is probably what you are looking for.<BR><BR>Tom<BR><BR><BR><SPAN 
    style="FONT-WEIGHT: bold">On Mon 7/09/09 1:27 PM , Rui Gonçalves <A 
    href="mailto:rui.pinho.goncalves@gmail.com" 
    target=_blank>rui.pinho.goncalves@gmail.com</A> sent:<BR></SPAN>
    <BLOCKQUOTE 
    style="BORDER-LEFT: rgb(245,245,245) 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
      <DIV class=im>
      <P>Hi All,</P>
      <P>&nbsp;</P>
      <P>I’m relatively new to Mondrian and Jpivot .</P>
      <P>I would like to have a calculated total for hierarquies and 
level’s.</P>
      <P>Example:</P>
      <P>select NON EMPTY {[Measures].[Quantity]} ON COLUMNS,<BR>&nbsp; NON 
      EMPTY Hierarchize(Union({[Product].[All Products]}, [Product].[All 
      Products].Children)) ON ROWS<BR>from [SteelWheelsSales]<BR></P>
      <P><BR></P>Output: <BR></DIV>
      <TABLE border=0 cellSpacing=1 cellPadding=2>
        <TBODY>
        <TR>
          <TH noWrap><BR></TH>
          <TH noWrap><IMG alt="Blocked image" src="">Measures</TH></TR>
        <TR>
          <TH noWrap><IMG alt="Blocked image" src="">Product</TH>
          <TH noWrap><INPUT title="Natural Order" border=0 width=9 height=9 
            type=image name=wcf35991a80><IMG alt="Blocked image" 
          src="">Quantity</TH></TR>
        <TR>
          <TD>
            <DIV class=im></DIV>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 0em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcff19b7854>All Products</DIV></TH>
          <TD noWrap>105.331</TD></TR>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 1em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcfffa64ca>Classic Cars</DIV></TH>
          <TD noWrap>35.552</TD></TR>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 1em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcf44ed35ef>Motorcycles</DIV></TH>
          <TD noWrap>12.708</TD></TR>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 1em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcf6992b59c>Planes</DIV></TH>
          <TD noWrap>11.860</TD></TR>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 1em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcfeaa422cc>Ships</DIV></TH>
          <TD noWrap>8.499</TD></TR>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 1em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcf4a359c9>Trains</DIV></TH>
          <TD noWrap>2.818</TD></TR>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 1em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcf525dad6c>Trucks and Buses</DIV></TH>
          <TD noWrap>11.001</TD></TR>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 1em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcf5b7c05de>Vintage Cars</DIV></TH>
          <TD noWrap>22.893</TD></TR></TD></TBODY></TABLE>
      <DIV class=im>
      <P><BR></P>In this sample, the total for the product column is the same as 
      the value for [Product].[All Products]<BR>
      <P></P>
      <P><BR></P>
      <P>If the user wishes to select only some of the "products" in the 
      hierarquie:</P>
      <P><BR></P>
      <P>For Example:<BR></P>
      <P>select NON EMPTY {[Measures].[Quantity]} ON COLUMNS,<BR>&nbsp; NON 
      EMPTY {[Product].[All Products], [Product].[All Products].[Classic Cars], 
      [Product].[All Products].[Vintage Cars]} ON ROWS<BR>from 
      [SteelWheelsSales]<BR></P>
      <P><BR></P>
      <P>The Output is:<BR></P></DIV>
      <TABLE border=0 cellSpacing=1 cellPadding=2>
        <TBODY>
        <TR>
          <TH noWrap><BR></TH>
          <TH noWrap><IMG alt="Blocked image" src="">Measures</TH></TR>
        <TR>
          <TH noWrap><IMG alt="Blocked image" src="">Product</TH>
          <TH noWrap><INPUT title="Natural Order" border=0 width=9 height=9 
            type=image name=wcf9416e090><IMG alt="Blocked image" 
          src="">Quantity</TH></TR>
        <TR>
          <TD>
            <DIV class=im></DIV>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 0em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcf9d75b0ae>All Products</DIV></TH>
          <TD noWrap>105.331</TD></TR>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 1em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcfba75fce3>Classic Cars</DIV></TH>
          <TD noWrap>35.552</TD></TR>
        <TR>
          <TH noWrap>
            <DIV style="MARGIN-LEFT: 1em"><INPUT title="" border=0 width=16 
            height=16 type=image name=wcf7931ef63>Vintage Cars</DIV></TH>
          <TD noWrap>22.893</TD></TR></TD></TBODY></TABLE>
      <DIV class=im>
      <P><BR></P>
      <P>And the total for this column will be 58.445 (Classic Cars + Vintage 
      Cars)<BR></P>
      <P><BR></P>
      <P>&nbsp;</P>
      <P>I would like to know if it's possible to create a calculated column (or 
      some other thing) that computes the total for whatever slices are selected 
      by the user in a hierarquie. Is it possible to do it using running totals? 
      If so could you advise how?<BR></P>
      <P><BR></P>
      <P>I need this total value to use it in some more calculations, like some 
      percentages and so on.</P>
      <P><BR></P>
      <P><BR></P>
      <P>The really nice solution would be to have a way to tell Mondrian to 
      calculate a total for the (displayed values in a) 
      [Dimension].[Hierarquie]</P>
      <P>&nbsp;</P>
      <P><BR></P>
      <P>Thank's<BR></P>
      <P>Regards,</P>
      <P>Rui<BR></P></DIV></BLOCKQUOTE><BR><BR>_______________________________________________<BR>Mondrian 
    mailing list<BR><A 
    href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</A><BR><A 
    href="http://lists.pentaho.org/mailman/listinfo/mondrian" 
    target=_blank>http://lists.pentaho.org/mailman/listinfo/mondrian</A><BR><BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>