Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Calulated members & aggregate tables

  1. #1
    Join Date
    Nov 2007
    Posts
    15

    Default Calulated members & aggregate tables

    Hi.
    I've noticed that if calculated members are defined in the cube, Mondrian doesn't use anymore the aggregate tables I've defined.
    Instead, everything work as expected if I define the same (calculated) members directly into the MDX.
    Is there a reason for this?

    Just for reference, here is a sample calculated member that causes the problem:
    Code:
    <CalculatedMember name="MonthCount" dimension="Measures">
    	<Formula>
    		sum(
    			descendants(
    				[Time].CurrentMember,
    				[Time].levels( 2 )
    			),
    			iif(
    				isEmpty( ( [Time].CurrentMember, [Measures].[Cost] ) ),
    				0,
    				1
    			)
    		)
    	</Formula>
    </CalculatedMember>

  2. #2
    Join Date
    Nov 1999
    Posts
    1,618

    Default

    You're saying that if you were to write

    Code:
    WITH MEMBER [Measures].[MonthCount] AS '
    sum(
    			descendants(
    				[Time].CurrentMember,
    				[Time].levels( 2 )
    			),
    			iif(
    				isEmpty( ( [Time].CurrentMember, [Measures].[Cost] ) ),
    				0,
    				1
    			)
    		) '
    SELECT ...

    then mondrian would use the aggregate tables? Knowing the way that mondrian evaluates calculated members, I find that hard to believe.

    Note that calculated members - defined in the query or the cube alike - will prevent mondrian from using an aggregate table until they have been expanded.

    In particular, mondrian is not smart enough to use an aggregate table to evaluate sum(descendants(...)) even though it may seem obvious how to.

    Julian

  3. #3
    Join Date
    Nov 2007
    Posts
    15

    Default

    Quote Originally Posted by jhyde View Post
    You're saying that if you were to write

    Code:
    WITH MEMBER [Measures].[MonthCount] AS '
    ...
    then mondrian would use the aggregate tables? Knowing the way that mondrian evaluates calculated members, I find that hard to believe.
    Yes, it's just like that!
    In fact, my current workaround is to do not use any calculated member, but copy'n'paste thier formulae in each MDX query.
    It could be that the problem lies somewhere else in my cube definition and it is somehow triggered by the presence of a calculated member, I don't know...

    Quote Originally Posted by jhyde View Post
    In particular, mondrian is not smart enough to use an aggregate table to evaluate sum(descendants(...)) even though it may seem obvious how to.
    I'll check and I'll post more details as soon as my test environment will be available.

    Bye

  4. #4
    Join Date
    Nov 2007
    Posts
    15

    Default

    The problem doesn't happen anymore...
    I've changed something here and there since I've first experienced the problem, but I cannot reproduce it now... sorry.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.