Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: [Mondrian] Evaluating an axis expression to used dimension members

  1. #1
    Pappyn Bart Guest

    Default [Mondrian] Evaluating an axis expression to used dimension members

    Hi,

    I am looking for a way to evaluate an axis expression (QueryAxis), to a list of used members.

    For example DrilldownLevel({[Store].[All stores]}) should evaluate to a list of store members.

    This should be able to happen before running the query (and wasting too much time), since I am writing a mdx preprocessor.

    Thanks,
    Bart

    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  2. #2
    Luc Boudreau Guest

    Default Re: [Mondrian] Evaluating an axis expression to used dimensionmembers

    Bart,

    If you want to evaluate a complex axis expression, composed of many levels
    and MDX functions, I don't know of any other way than to execute the query
    outright.

    However, if you want to evaluate the members of a single level, it is
    possible to do it without executing an MDX query. If you are using olap4j,
    you can obtain the list of members of a level by doing Level.getMembers() =>
    List<Member>. There is another way using the Mondrian internal code, but I
    wouldn't recommend going down that road, as we reserve the right to change
    it at anytime, thus potentially breaking your application.

    Does this help you achieving what you want?

    Luc

    On Thu, Aug 25, 2011 at 4:20 AM, Pappyn Bart <Bart.Pappyn (AT) vandewiele (DOT) com>wrote:

    > Hi,****
    >
    > ** **
    >
    > I am looking for a way to evaluate an axis expression (QueryAxis), to a
    > list of used members.****
    >
    > ** **
    >
    > For example DrilldownLevel({[Store].[All stores]}) should evaluate to a
    > list of store members.****
    >
    > ** **
    >
    > This should be able to happen before running the query (and wasting too
    > much time), since I am writing a mdx preprocessor.****
    >
    > ** **
    >
    > Thanks,****
    >
    > Bart****
    >
    > _______________________________________________
    > Mondrian mailing list
    > Mondrian (AT) pentaho (DOT) org
    > http://lists.pentaho.org/mailman/listinfo/mondrian
    >
    >


    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  3. #3
    Pappyn Bart Guest

    Default Re: [Mondrian] Evaluating an axis expression to useddimension members

    I am not using olap4j for the moment, I am still using a mondrian/jpivot combination with direct connection (no xmla).

    I have used the mdx parser of Mondrian, derived from it and also written a custom Validator. I also derived from ValidatorImpl, but I had to modify the Mondrian code to make this class public.

    This way I am able to dynamically modify MDX with low effort (using the code of Mondrian).

    It gets me halfway, since I need some information of how axes will evaluate (which members are needed).

    I have tried to use Object value = axisCalc.evaluate(evaluator); to some extend it is successful, but if the query is too complex, the result is too difficult to parse.

    For the moment, I see no other way than executing a query in the likes of TestContext.executeAxis(). But this always loads some cell information also… After the mdx is generated by my piece of code, jpivot kicks in and evaluates the query. I want to prevent that the query is evaluated twice…

    From: mondrian-bounces (AT) pentaho (DOT) org [mailto:mondrian-bounces (AT) pentaho (DOT) org] On Behalf Of Luc Boudreau
    Sent: donderdag 25 augustus 2011 15:26
    To: Mondrian developer mailing list
    Subject: Re: [Mondrian] Evaluating an axis expression to used dimension members

    Bart,

    If you want to evaluate a complex axis expression, composed of many levels and MDX functions, I don't know of any other way than to execute the query outright.

    However, if you want to evaluate the members of a single level, it is possible to do it without executing an MDX query. If you are using olap4j, you can obtain the list of members of a level by doing Level.getMembers() => List<Member>. There is another way using the Mondrian internal code, but I wouldn't recommend going down that road, as we reserve the right to change it at anytime, thus potentially breaking your application.

    Does this help you achieving what you want?

    Luc
    On Thu, Aug 25, 2011 at 4:20 AM, Pappyn Bart <Bart.Pappyn (AT) vandewiele (DOT) com<mailto:Bart.Pappyn (AT) vandewiele (DOT) com>> wrote:
    Hi,

    I am looking for a way to evaluate an axis expression (QueryAxis), to a list of used members.

    For example DrilldownLevel({[Store].[All stores]}) should evaluate to a list of store members.

    This should be able to happen before running the query (and wasting too much time), since I am writing a mdx preprocessor.

    Thanks,
    Bart

    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org<mail...taho (DOT) org>
    http://lists.pentaho.org/mailman/listinfo/mondrian

    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

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.