[Mondrian] LastNonEmpty and slicers problem

Matt Campbell mcampbell at pentaho.com
Tue Oct 14 11:52:13 EDT 2014

I believe the 2 workarounds are to either inline the named set directly on the axis, or use a calculated member that aggregates the set you’re currently using in the slicer, and place that calculated member in the slicer instead.  E.g.

With member
Product.agg as ‘ Aggregate( {[product].[product].[a], [product].[product].[c]})’
( product.agg )


From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On Behalf Of Hilario Fernandes
Sent: Tuesday, October 14, 2014 11:42 AM
To: Mondrian developer mailing list
Subject: Re: [Mondrian] LastNonEmpty and slicers problem

Hey Matt,

Thanks for the reply! I've put the set directly on the axis and it works as expected. I've added the information on the issue you pointed out and voted! Guess there's nothing else i can do at the moment... I'm going to try and find a workaround of some sort...

On Tue, Oct 14, 2014 at 1:28 PM, Matt Campbell <mcampbell at pentaho.com<mailto:mcampbell at pentaho.com>> wrote:

Hi Hilario,
There’s a known issue with named set evaluation in the context of a compound slicer (MONDRIAN-1654).  Can you try moving the [date] set directly onto the row axis to see whether you get expected numbers?  And if that is your issue, vote and/or comment on the case.  I’d love to see it get addressed.


From: mondrian-bounces at pentaho.org<mailto:mondrian-bounces at pentaho.org> [mailto:mondrian-bounces at pentaho.org<mailto:mondrian-bounces at pentaho.org>] On Behalf Of Hilario Fernandes
Sent: Monday, October 13, 2014 12:43 PM
To: Mondrian mailing list
Subject: [Mondrian] LastNonEmpty and slicers problem


I'm experiencing a weird behaviour while using the LastNonEmpty function. My MDX is as follows:

SET [date] AS
{LastNonEmpty([date.YEAR].[YEAR].Members, [Measures].[measure_SUM])}

NON EMPTY {[Measures].[measure_SUM]} ON COLUMNS,

FROM [cube]
WHERE {[product].[product].[a], [product].[product].[c]}

The schema:

<Cube name='cube' visible='true' cache='true' enabled='true'>
  <Table name='CUBE_609d989076e048e2a9ee831bdeaee2b3_FACT' alias='FACT_252ad422f6ae474fb25001f7586bdbd2' />
   <Dimension name='product' caption='product' visible='true'>
    <Hierarchy name='product' caption='product' allMemberName='Total product' visible='true' hasAll='true'>
      <Level name='product' caption='product' visible='true' column='ATTR_c7a295ae3dfa4af9acaacc56fc16c276' uniqueMembers='true' levelType='Regular' hideMemberIf='Never' type='String' />
  <DimensionUsage name='date' source='Shared Date' caption='date' visible='true' foreignKey='DIM_ID_b6c96b55efdd430b8b991d20f6eef622' />
  <Measure caption='measure_SUM' name='measure_SUM' column='MEASURE_bfe8f487ff6846b58195028020207647' formatString='Standard' aggregator='sum' />

and the data:

product, date, measure
a,2014-01-01, 10
b,2014-01-01, 20

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 LastNonEmpty evaluation. In this case it returns nothing, because the measure is null for [product].[product].[c].

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.

I appreciate any help! Thank you!

Hilario Fernandes

Mondrian mailing list
Mondrian at pentaho.org<mailto:Mondrian at pentaho.org>

Hilario Fernandes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20141014/9a91426e/attachment-0001.html 

More information about the Mondrian mailing list