<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi Hilario,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">There’s a known issue with named set evaluation in the context of a compound slicer (MONDRIAN-1654).&nbsp; Can you try moving the [date] set directly onto the row
 axis to see whether you get expected numbers?&nbsp; And if that <i>is</i> your issue, vote and/or comment on the case.&nbsp; I’d love to see it get addressed.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Matt<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"> mondrian-bounces@pentaho.org [mailto:mondrian-bounces@pentaho.org]
<b>On Behalf Of </b>Hilario Fernandes<br>
<b>Sent:</b> Monday, October 13, 2014 12:43 PM<br>
<b>To:</b> Mondrian mailing list<br>
<b>Subject:</b> [Mondrian] LastNonEmpty and slicers problem<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I'm experiencing a weird behaviour while using the LastNonEmpty function. My MDX is as follows:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">WITH<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">SET [date] AS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">{LastNonEmpty([date.YEAR].[YEAR].Members, [Measures].[measure_SUM])}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">SELECT<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">NON EMPTY {[Measures].[measure_SUM]} ON COLUMNS,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">NON EMPTY {[date]} ON ROWS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">FROM [cube]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">WHERE {[product].[product].[a], [product].[product].[c]}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">The schema:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">&lt;Cube name='cube' visible='true' cache='true' enabled='true'&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &lt;Table name='CUBE_609d989076e048e2a9ee831bdeaee2b3_FACT' alias='FACT_252ad422f6ae474fb25001f7586bdbd2' /&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp;&lt;Dimension name='product' caption='product' visible='true'&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;Hierarchy name='product' caption='product' allMemberName='Total product' visible='true' hasAll='true'&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &lt;Level name='product' caption='product' visible='true' column='ATTR_c7a295ae3dfa4af9acaacc56fc16c276' uniqueMembers='true' levelType='Regular' hideMemberIf='Never' type='String' /&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;/Hierarchy&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &lt;/Dimension&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &lt;DimensionUsage name='date' source='Shared Date' caption='date' visible='true' foreignKey='DIM_ID_b6c96b55efdd430b8b991d20f6eef622' /&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &lt;Measure caption='measure_SUM' name='measure_SUM' column='MEASURE_bfe8f487ff6846b58195028020207647' formatString='Standard' aggregator='sum' /&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&lt;/Cube&gt;<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<p class="MsoNormal">and the data:<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">product, date, measure<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">a,2014-01-01, 10<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">b,2014-01-01, 20<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">c,-,null<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">The problem is i'd expect the above query to return the sum of the measure for the year 2014, considering the slicers, but it doesn't. Seems like the slicers aren't being properly applyed, and only the last of the set is considered during&nbsp;LastNonEmpty
 evaluation. In this case it returns nothing, because the measure is null for [product].[product].[c].<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Is this a known problem or am i doing something wrong? I've been debugging mondrian code trying to understand what's going on hoping to narrow the problem and it seems to be related to LastNonEmpty.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I appreciate any help! Thank you!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">Hilario Fernandes<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>