<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 12"><meta name="Originator" content="Microsoft Word 12"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CRGONCA%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"><link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CRGONCA%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"><link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CRGONCA%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"><style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:roman;
        mso-font-pitch:variable;
        mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:swiss;
        mso-font-pitch:variable;
        mso-font-signature:-1610611985 1073750139 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-unhide:no;
        mso-style-qformat:yes;
        mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-ascii-font-family:Calibri;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Calibri;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
span.EmailStyle15
        {mso-style-type:personal;
        mso-style-noshow:yes;
        mso-style-unhide:no;
        mso-ansi-font-size:11.0pt;
        mso-bidi-font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-ascii-font-family:Calibri;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Calibri;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-default-props:yes;
        mso-ascii-font-family:Calibri;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Calibri;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style>

<p class="MsoNormal">Hi All,</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">I’m relatively new to Mondrian and Jpivot .</p>

<p class="MsoNormal">I would like to have a calculated total for hierarquies and level’s.</p>

<p class="MsoNormal">Example:</p>

<p class="MsoNormal">select NON EMPTY {[Measures].[Quantity]} ON COLUMNS,<br>
  NON EMPTY Hierarchize(Union({[Product].[All Products]}, [Product].[All Products].Children)) ON ROWS<br>
from [SteelWheelsSales]<br>
</p>
<p class="MsoNormal"><br>
</p>Output: <br><table class="mdxtable" id="table9484d0bb-9ba3-11de-9294-b9bdcbcba4a3" border="0" cellpadding="2" cellspacing="1"><tbody>
<tr>
<th class="corner-heading" nowrap><br></th>
<th class="heading-heading" nowrap><img src="/pentaho/jpivot/table/drill-position-other.gif" width="9" border="0" height="9">Measures</th></tr>
<tr>
<th class="heading-heading" nowrap><img src="/pentaho/jpivot/table/drill-position-other.gif" width="9" border="0" height="9">Product</th>
<th class="column-heading-even" nowrap><input title="Natural Order" src="/pentaho/jpivot/table/sort-natural.gif" name="wcf35991a80" type="image" width="9" border="0" height="9"><img src="/pentaho/jpivot/table/drill-position-other.gif" width="9" border="0" height="9">Quantity</th>
</tr>
<tr>
<th class="row-heading-even" nowrap>
<div style="margin-left: 0em;"><input title="" src="/pentaho/jpivot/table/drill-position-collapse.gif" name="wcff19b7854" type="image" width="16" border="0" height="16">All Products</div></th>
<td class="cell-even" nowrap>105.331</td></tr>
<tr>
<th class="row-heading-odd" nowrap>
<div style="margin-left: 1em;"><input title="" src="/pentaho/jpivot/table/drill-position-expand.gif" name="wcfffa64ca" type="image" width="16" border="0" height="16">Classic Cars</div></th>
<td class="cell-odd" nowrap>35.552</td></tr>
<tr>
<th class="row-heading-even" nowrap>
<div style="margin-left: 1em;"><input title="" src="/pentaho/jpivot/table/drill-position-expand.gif" name="wcf44ed35ef" type="image" width="16" border="0" height="16">Motorcycles</div></th>
<td class="cell-even" nowrap>12.708</td></tr>
<tr>
<th class="row-heading-odd" nowrap>
<div style="margin-left: 1em;"><input title="" src="/pentaho/jpivot/table/drill-position-expand.gif" name="wcf6992b59c" type="image" width="16" border="0" height="16">Planes</div></th>
<td class="cell-odd" nowrap>11.860</td></tr>
<tr>
<th class="row-heading-even" nowrap>
<div style="margin-left: 1em;"><input title="" src="/pentaho/jpivot/table/drill-position-expand.gif" name="wcfeaa422cc" type="image" width="16" border="0" height="16">Ships</div></th>
<td class="cell-even" nowrap>8.499</td></tr>
<tr>
<th class="row-heading-odd" nowrap>
<div style="margin-left: 1em;"><input title="" src="/pentaho/jpivot/table/drill-position-expand.gif" name="wcf4a359c9" type="image" width="16" border="0" height="16">Trains</div></th>
<td class="cell-odd" nowrap>2.818</td></tr>
<tr>
<th class="row-heading-even" nowrap>
<div style="margin-left: 1em;"><input title="" src="/pentaho/jpivot/table/drill-position-expand.gif" name="wcf525dad6c" type="image" width="16" border="0" height="16">Trucks and Buses</div></th>
<td class="cell-even" nowrap>11.001</td></tr>
<tr>
<th class="row-heading-odd" nowrap>
<div style="margin-left: 1em;"><input title="" src="/pentaho/jpivot/table/drill-position-expand.gif" name="wcf5b7c05de" type="image" width="16" border="0" height="16">Vintage Cars</div></th>
<td class="cell-odd" nowrap>22.893</td></tr></tbody></table><p class="MsoNormal"><br></p>In this sample, the total for the product column is the same as the value for [Product].[All Products]<br><p class="MsoNormal"></p>
<p class="MsoNormal"><br></p><p class="MsoNormal">If the user wishes to select only some of the &quot;products&quot; in the hierarquie:</p><p class="MsoNormal"><br></p><p class="MsoNormal">For Example:<br></p><p class="MsoNormal">
select NON EMPTY {[Measures].[Quantity]} ON COLUMNS,<br>  NON EMPTY {[Product].[All Products], [Product].[All Products].[Classic Cars], [Product].[All Products].[Vintage Cars]} ON ROWS<br>from [SteelWheelsSales]<br></p><p class="MsoNormal">
<br></p><p class="MsoNormal">The Output is:<br></p><table class="mdxtable" id="table9484d0bb-9ba3-11de-9294-b9bdcbcba4a3" border="0" cellpadding="2" cellspacing="1"><tbody>
<tr>
<th class="corner-heading" nowrap><br></th>
<th class="heading-heading" nowrap><img src="/pentaho/jpivot/table/drill-position-other.gif" width="9" border="0" height="9">Measures</th></tr>
<tr>
<th class="heading-heading" nowrap><img src="/pentaho/jpivot/table/drill-position-other.gif" width="9" border="0" height="9">Product</th>
<th class="column-heading-even" nowrap><input title="Natural Order" src="/pentaho/jpivot/table/sort-natural.gif" name="wcf9416e090" type="image" width="9" border="0" height="9"><img src="/pentaho/jpivot/table/drill-position-other.gif" width="9" border="0" height="9">Quantity</th>
</tr>
<tr>
<th class="row-heading-even" nowrap>
<div style="margin-left: 0em;"><input title="" src="/pentaho/jpivot/table/drill-position-collapse.gif" name="wcf9d75b0ae" type="image" width="16" border="0" height="16">All Products</div></th>
<td class="cell-even" nowrap>105.331</td></tr>
<tr>
<th class="row-heading-odd" nowrap>
<div style="margin-left: 1em;"><input title="" src="/pentaho/jpivot/table/drill-position-expand.gif" name="wcfba75fce3" type="image" width="16" border="0" height="16">Classic Cars</div></th>
<td class="cell-odd" nowrap>35.552</td></tr>
<tr>
<th class="row-heading-even" nowrap>
<div style="margin-left: 1em;"><input title="" src="/pentaho/jpivot/table/drill-position-expand.gif" name="wcf7931ef63" type="image" width="16" border="0" height="16">Vintage Cars</div></th>
<td class="cell-even" nowrap>22.893</td></tr></tbody></table><p class="MsoNormal"><br></p><p class="MsoNormal">And the total for this column will be 58.445 (Classic Cars + Vintage Cars)<br></p><p class="MsoNormal"><br></p>
<p class="MsoNormal"> </p><p class="MsoNormal">I would like to know if it&#39;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 class="MsoNormal"><br></p>

<p class="MsoNormal">I need this total value to use it in some more calculations,
like some percentages and so on.</p>

<p class="MsoNormal"><br></p><p class="MsoNormal"><br></p>

<p class="MsoNormal">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 class="MsoNormal"> </p><p class="MsoNormal"><br></p><p class="MsoNormal">Thank&#39;s<br></p><p class="MsoNormal">Regards,</p><p class="MsoNormal">Rui<br></p>