Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Since version 2.1.1 (The previous version I worked with
      was 2.0.1), it is not possible to get a property from
      the CurrentMember when the dimension contains more than
      one hierarchy. Previously it worked just fine. Now my
      schema doesn't work any more. I replicated the problem
      using the foodmart data and included a snapshot of the
      dimension and the MDX query below.
       
      Thanks !
      ---------------------------------------
      <Dimension name="Store">
      <Hierarchy hasAll="true" primaryKey="store_id">
      <Table name="store"/>
      <Level name="Store Country" column="store_country"
      uniqueMembers="true"/>
      <Level name="Store State" column="store_state"
      uniqueMembers="true"/>
      <Level name="Store City" column="store_city"
      uniqueMembers="false"/>
      <Level name="Store Name" column="store_name"
      uniqueMembers="true">
      <Property name="Store Type" column="store_type"/>
      <Property name="Store Manager" column="store_manager"/>
      <Property name="Store Sqft" column="store_sqft"
      type="Numeric"/>
      <Property name="Grocery Sqft" column="grocery_sqft"
      type="Numeric"/>
      <Property name="Frozen Sqft" column="frozen_sqft"
      type="Numeric"/>
      <Property name="Meat Sqft" column="meat_sqft"
      type="Numeric"/>
      <Property name="Has coffee bar" column="coffee_bar"
      type="Boolean"/>
      <Property name="Street address"
      column="store_street_address" type="String"/>
      </Level>
      </Hierarchy>
      <Hierarchy caption="Store2" name="Store2"
      allMemberName="All store2s" hasAll="true"
      primaryKey="store_id">
      <Table name="store"/>
      <Level name="Store City" column="store_city"
      uniqueMembers="false"/>
      <Level name="Store Name" column="store_name"
      uniqueMembers="true">
      <Property name="Store Type" column="store_type"/>
      <Property name="Store Manager" column="store_manager"/>
      <Property name="Store Sqft" column="store_sqft"
      type="Numeric"/>
      <Property name="Grocery Sqft" column="grocery_sqft"
      type="Numeric"/>
      <Property name="Frozen Sqft" column="frozen_sqft"
      type="Numeric"/>
      <Property name="Meat Sqft" column="meat_sqft"
      type="Numeric"/>
      <Property name="Has coffee bar" column="coffee_bar"
      type="Boolean"/>
      <Property name="Street address"
      column="store_street_address" type="String"/>
      </Level>
      </Hierarchy>
      </Dimension>
      ---------------------------------------
      with member [Measures].[store level] as '[Store].
      CurrentMember.Level.Name'
      member [Measures].[store type] as 'IIf(([Store].
      CurrentMember.Level.Name = "Store Name"), [Store].
      CurrentMember.Properties("Store Type"), "No type")'
      member [Measures].[Store Sqft] as 'IIf(([Store].
      CurrentMember.Level.Name = "Store Name"), [Store].
      CurrentMember.Properties("Store Sqft"), 0.0)'
      select {[Measures].[Unit Sales], [Measures].[Store
      Cost], [Measures].[Store Sales], [Measures].[store
      level], [Measures].[store type], [Measures].[Store
      Sqft]} ON COLUMNS,
      {[Store].[All Stores], [Store].[All Stores].[Canada],
      [Store].[All Stores].[Canada].[BC], [Store].[All
      Stores].[Canada].[BC].[Vancouver], [Store].[All Stores
      ].[Canada].[BC].[Vancouver].[Store 19], [Store].[All
      Stores].[Canada].[BC].[Victoria], [Store].[All Stores].
      [Mexico], [Store].[All Stores].[USA]} ON ROWS
      from [Sales]
      where [Time].[1997]
      ---------------------------------------
       
      [JPivot] 01 jun 2006 10:58:53,531 ERROR [Session
      0B02FB9FAAED6A9AA6D92CCCBF442AE9] com.tonbeller.jpivot.
      mondrian.MondrianModel#parseMDX: Parse Failure
       
      mondrian.olap.MondrianException: Mondrian Error:Failed
      to parse query 'with member [Measures].[store level] as
      '[Store].CurrentMember.Level.Name'
       
      member [Measures].[store type] as 'IIf(([Store].
      CurrentMember.Level.Name = "Store Name"), [Store].
      CurrentMember.Properties("Store Type"), "No type")'
       
      member [Measures].[Store Sqft] as 'IIf(([Store].
      CurrentMember.Level.Name = "Store Name"), [Store].
      CurrentMember.Properties("Store Sqft"), 0.0)'
       
      select {[Measures].[Unit Sales], [Measures].[Store
      Cost], [Measures].[Store Sales], [Measures].[store
      level], [Measures].[store type], [Measures].[Store
      Sqft]} ON COLUMNS,
       
      {[Store].[All Stores], [Store].[All Stores].[Canada],
      [Store].[All Stores].[Canada].[BC], [Store].[All
      Stores].[Canada].[BC].[Vancouver], [Store].[All Stores
      ].[Canada].[BC].[Vancouver].[Store 19], [Store].[All
      Stores].[Canada].[BC].[Victoria], [Store].[All Stores].
      [Mexico], [Store].[All Stores].[USA]} ON ROWS
       
      from [Sales]
       
      where [Time].[1997]
      '
       
      at mondrian.resource.MondrianResource$_Def0.
      ex(MondrianResource.java:1035)
       
      at mondrian.olap.ConnectionBase.
      parseQuery(ConnectionBase.java:68)
       
      at com.tonbeller.jpivot.mondrian.MondrianModel.
      parseMDX(MondrianModel.java:424)
       
      at com.tonbeller.jpivot.mondrian.MondrianModel.
      setUserMdx(MondrianModel.java:725)
       
      at com.tonbeller.jpivot.mondrian.MondrianMdxQuery.
      setMdxQuery(MondrianMdxQuery.java:45)
       
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
      Method)
       
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
      Source)
       
      at sun.reflect.DelegatingMethodAccessorImpl.
      invoke(Unknown Source)
       
      at java.lang.reflect.Method.invoke(Unknown Source)
       
      at org.apache.commons.beanutils.PropertyUtilsBean.
      invokeMethod(PropertyUtilsBean.java:1773)
       
      at org.apache.commons.beanutils.PropertyUtilsBean.
      setSimpleProperty(PropertyUtilsBean.java:1759)
       
      at org.apache.commons.beanutils.PropertyUtilsBean.
      setNestedProperty(PropertyUtilsBean.java:1648)
       
      at org.apache.commons.beanutils.PropertyUtilsBean.
      setProperty(PropertyUtilsBean.java:1677)
       
      at org.apache.commons.beanutils.PropertyUtils.
      setProperty(PropertyUtils.java:559)
       
      at com.tonbeller.wcf.convert.EditCtrlConverter.
      convert(EditCtrlConverter.java:72)
       
      at com.tonbeller.wcf.convert.ConverterImpl.
      traverse(ConverterImpl.java:88)
       
      at com.tonbeller.wcf.convert.ConverterImpl.
      traverse(ConverterImpl.java:111)
       
      at com.tonbeller.wcf.convert.ConverterImpl.
      traverse(ConverterImpl.java:111)
       
      at com.tonbeller.wcf.convert.ConverterImpl.
      traverse(ConverterImpl.java:111)
       
      at com.tonbeller.wcf.convert.ConverterImpl.
      traverse(ConverterImpl.java:111)
       
      at com.tonbeller.wcf.convert.ConverterImpl.
      traverse(ConverterImpl.java:111)
       
      at com.tonbeller.wcf.convert.ConverterImpl.
      validate(ConverterImpl.java:65)
       
      at com.tonbeller.wcf.form.FormComponent.
      validate(FormComponent.java:100)
       
      at com.tonbeller.wcf.form.ButtonHandler.
      request(ButtonHandler.java:94)
       
      at com.tonbeller.wcf.controller.DispatcherSupport.
      request(DispatcherSupport.java:167)
       
      at com.tonbeller.wcf.component.ComponentSupport.
      request(ComponentSupport.java:104)
       
      at com.tonbeller.wcf.controller.WcfController.
      request(WcfController.java:71)
       
      at com.tonbeller.wcf.controller.
      RequestFilter$MyHandler.normalRequest(RequestFilter.
      java:119)
       
      at com.tonbeller.wcf.controller.RequestSynchronizer.
      handleRequest(RequestSynchronizer.java:127)
       
      at com.tonbeller.wcf.controller.RequestFilter.
      doFilter(RequestFilter.java:263)
       
      at org.apache.catalina.core.ApplicationFilterChain.
      internalDoFilter(ApplicationFilterChain.java:202)
       
      at org.apache.catalina.core.ApplicationFilterChain.
      doFilter(ApplicationFilterChain.java:173)
       
      at org.apache.catalina.core.StandardWrapperValve.
      invoke(StandardWrapperValve.java:213)
       
      at org.apache.catalina.core.StandardContextValve.
      invoke(StandardContextValve.java:178)
       
      at org.apache.catalina.core.StandardHostValve.
      invoke(StandardHostValve.java:126)
       
      at org.apache.catalina.valves.ErrorReportValve.
      invoke(ErrorReportValve.java:105)
       
      at org.apache.catalina.core.StandardEngineValve.
      invoke(StandardEngineValve.java:107)
       
      at org.apache.catalina.connector.CoyoteAdapter.
      service(CoyoteAdapter.java:148)
       
      at org.apache.coyote.http11.Http11Processor.
      process(Http11Processor.java:869)
       
      at org.apache.coyote.http11.
      Http11BaseProtocol$Http11ConnectionHandler.
      processConnection(Http11BaseProtocol.java:664)
       
      at org.apache.tomcat.util.net.PoolTcpEndpoint.
      processSocket(PoolTcpEndpoint.java:527)
       
      at org.apache.tomcat.util.net.
      LeaderFollowerWorkerThread.
      runIt(LeaderFollowerWorkerThread.java:80)
       
      at org.apache.tomcat.util.threads.
      ThreadPool$ControlRunnable.run(ThreadPool.java:684)
       
      at java.lang.Thread.run(Unknown Source)
       
      Caused by: mondrian.olap.MondrianException: Mondrian
      Error:Error while parsing MDX statement 'with member
      [Measures].[store level] as '[Store].CurrentMember.
      Level.Name'
       
      member [Measures].[store type] as 'IIf(([Store].
      CurrentMember.Level.Name = "Store Name"), [Store].
      CurrentMember.Properties("Store Type"), "No type")'
       
      member [Measures].[Store Sqft] as 'IIf(([Store].
      CurrentMember.Level.Name = "Store Name"), [Store].
      CurrentMember.Properties("Store Sqft"), 0.0)'
       
      select {[Measures].[Unit Sales], [Measures].[Store
      Cost], [Measures].[Store Sales], [Measures].[store
      level], [Measures].[store type], [Measures].[Store
      Sqft]} ON COLUMNS,
       
      {[Store].[All Stores], [Store].[All Stores].[Canada],
      [Store].[All Stores].[Canada].[BC], [Store].[All
      Stores].[Canada].[BC].[Vancouver], [Store].[All Stores
      ].[Canada].[BC].[Vancouver].[Store 19], [Store].[All
      Stores].[Canada].[BC].[Victoria], [Store].[All Stores].
      [Mexico], [Store].[All Stores].[USA]} ON ROWS
       
      from [Sales]
       
      where [Time].[1997]
      '
       
      at mondrian.resource.MondrianResource$_Def0.
      ex(MondrianResource.java:1035)
       
      at mondrian.olap.Parser.parseInternal(Parser.java:648)
       
      at mondrian.olap.ConnectionBase.
      parseQuery(ConnectionBase.java:65)
       
      ... 42 more
       
      Caused by: java.lang.NullPointerException
       
      at mondrian.olap.fun.PropertiesFunDef$ResolverImpl.
      resolve(PropertiesFunDef.java:88)
       
      at mondrian.olap.fun.FunTableImpl.getDef(FunTableImpl.
      java:96)
       
      at mondrian.mdx.UnresolvedFunCall.
      accept(UnresolvedFunCall.java:85)
       
      at mondrian.olap.Query$StackValidator.validate(Query.
      java:879)
       
      at mondrian.mdx.UnresolvedFunCall.
      accept(UnresolvedFunCall.java:83)
       
      at mondrian.olap.Query$StackValidator.validate(Query.
      java:879)
       
      at mondrian.olap.Formula.accept(Formula.java:102)
       
      at mondrian.olap.Query$StackValidator.validate(Query.
      java:953)
       
      at mondrian.olap.Query.resolve(Query.java:265)
       
      at mondrian.olap.Query.resolve(Query.java:221)
       
      at mondrian.olap.Query.<init>(Query.java:113)
       
      at mondrian.olap.Query.<init>(Query.java:78)
       
      at mondrian.olap.Parser.makeQuery(Parser.java:730)
       
      at mondrian.olap.CUP$Parser$actions.
      CUP$Parser$do_action(Parser.java:1577)
       
      at mondrian.olap.Parser.do_action(Parser.java:576)
       
      at java_cup.runtime.lr_parser.parse(lr_parser.java:569)
       
      at mondrian.olap.Parser.parseInternal(Parser.java:643)
       
      ... 43 more
       
      [JPivot] 01 jun 2006 10:58:53,531 ERROR [Session
      0B02FB9FAAED6A9AA6D92CCCBF442AE9] com.tonbeller.jpivot.
      mondrian.MondrianModel#setUserMdx: setUserMdx failed
      null

        Activity

        Hide
        Mondrian Importer User added a comment -
        {weavelink}, 07/07/2006: priority, 5 |
        {weavelink}, 07/07/2006: summary, Properties not working with multiple hierachies |
        {jhyde}, 09/04/2006: status_id, 1 |
        {jhyde}, 09/04/2006: resolution_id, 100 |
        {jhyde}, 09/04/2006: assigned_to, 100 |
        {jhyde}, 09/04/2006: summary, Mondrian 2.1.1:Properties not working w/ multiple hierachies |
        {jhyde}, 09/04/2006: close_date, 0
        Show
        Mondrian Importer User added a comment - {weavelink}, 07/07/2006: priority, 5 | {weavelink}, 07/07/2006: summary, Properties not working with multiple hierachies | {jhyde}, 09/04/2006: status_id, 1 | {jhyde}, 09/04/2006: resolution_id, 100 | {jhyde}, 09/04/2006: assigned_to, 100 | {jhyde}, 09/04/2006: summary, Mondrian 2.1.1:Properties not working w/ multiple hierachies | {jhyde}, 09/04/2006: close_date, 0
        Hide
        Mondrian Importer User added a comment -
        {weavelink}, 08/17/2006: Logged In: YES
        user_id=1254631

        Maybe this stack trace is more meaningfull.

        mondrian.olap.MondrianException: Mondrian Error:Named set
        in cube 'Foodmart' has bad formula
         at
        mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:820)
         at
        mondrian.rolap.RolapCube.createCalcMembersAndNamedSets(RolapCube.java:511)
         at mondrian.rolap.RolapCube.<init>(RolapCube.java:318)
         at
        mondrian.rolap.RolapSchema.load(RolapSchema.java:316)
         at
        mondrian.rolap.RolapSchema.load(RolapSchema.java:229)
         at
        mondrian.rolap.RolapSchema.<init>(RolapSchema.java:170)
         at
        mondrian.rolap.RolapSchema.<init>(RolapSchema.java:49)
         at
        mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:797)
         at
        mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:636)
         at
        mondrian.rolap.RolapConnection.<init>(RolapConnection.java:138)
         at
        mondrian.rolap.RolapConnection.<init>(RolapConnection.java:73)
         at
        mondrian.olap.DriverManager.getConnection(DriverManager.java:120)
         at
        mondrian.olap.DriverManager.getConnection(DriverManager.java:87)
         at
        mondrian.olap.DriverManager.getConnection(DriverManager.java:55)
         at
        mondrian.web.servlet.MDXQueryServlet.processRequest(MDXQueryServlet.java:83)
         at
        mondrian.web.servlet.MDXQueryServlet.doGet(MDXQueryServlet.java:214)
         at
        javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at
        org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at
        org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at
        org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at
        org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at
        org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at
        org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at
        org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at
        org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at
        org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
        Show
        Mondrian Importer User added a comment - {weavelink}, 08/17/2006: Logged In: YES user_id=1254631 Maybe this stack trace is more meaningfull. mondrian.olap.MondrianException: Mondrian Error:Named set in cube 'Foodmart' has bad formula  at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:820)  at mondrian.rolap.RolapCube.createCalcMembersAndNamedSets(RolapCube.java:511)  at mondrian.rolap.RolapCube.<init>(RolapCube.java:318)  at mondrian.rolap.RolapSchema.load(RolapSchema.java:316)  at mondrian.rolap.RolapSchema.load(RolapSchema.java:229)  at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:170)  at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:49)  at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:797)  at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:636)  at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:138)  at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:73)  at mondrian.olap.DriverManager.getConnection(DriverManager.java:120)  at mondrian.olap.DriverManager.getConnection(DriverManager.java:87)  at mondrian.olap.DriverManager.getConnection(DriverManager.java:55)  at mondrian.web.servlet.MDXQueryServlet.processRequest(MDXQueryServlet.java:83)  at mondrian.web.servlet.MDXQueryServlet.doGet(MDXQueryServlet.java:214)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)  at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)  at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)  at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)  at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)  at java.lang.Thread.run(Unknown Source)
        Hide
        Mondrian Importer User added a comment -
        {weavelink}, 08/21/2006: Logged In: YES
        user_id=1254631

        I retested everything and documented the bug in more detail
        is this message on the forum. I hope this makes it easier
        to fix the problem.

        http://sourceforge.net/forum/
        forum.php?thread_id=1556498&forum_id=111376
        Show
        Mondrian Importer User added a comment - {weavelink}, 08/21/2006: Logged In: YES user_id=1254631 I retested everything and documented the bug in more detail is this message on the forum. I hope this makes it easier to fix the problem. http://sourceforge.net/forum/ forum.php?thread_id=1556498&forum_id=111376
        Hide
        Mondrian Importer User added a comment -
        {weavelink}, 09/01/2006: Logged In: YES
        user_id=1254631

        Hi,
         
        I added a new hierarchy to the foodmart store dimension,
        with the same properties defined as
        in the first (and default hierarchy).
         
        In some mdx query I use the following two :
         
        [Store].CurrentMember.Properties("Store Manager") -> Null
        Pointer Exception
        [Store.Store2].CurrentMember.Properties("Store Manager") ->
        works.
         
        When addressing the first hierarchy, in combination with
        CurrentMember, then
        I see in the debugger, a DimensionCurrentMemberFunDef is
        filled in the funDef
        and the hierarchy of the return type is not filled in.
         
        When addressing the second hierarchy, in combination with
        CurrentMember, then
        I see in the debugger, a HierarchyCurrentMemberFunDef is
        filled in the funDef
        and the hierarchy of the return type is filled in.
         
        The PropertiesFunDef.resolve() function takes the hierarchy
        of the return type to
        get to the levels of that hierarchy and to get the
        properties of that level.
         
        In the first case, the function has a null pointer
        exception at line 88.

        In PropertiesFunDef.resolve() I replaced the line
         
                         Level[] levels = hierarchy.getLevels();
         
        with these ones :


                        Level[] levels;
                        if (hierarchy == null)
                        {
                           // Get first and default hierarchy
                           levels =
        args[0].getType().getDimension().getHierarchy().getLevels();
                        }
                        else
                        {
                           levels = hierarchy.getLevels();
                        }

        And the problem is solved.
         
        I don't know if this workaround is the ideal solution ?

        I have another question about PropertiesFunDef.resolve() :
         
                        Property property = lookupProperty(
                                levels[levels.length - 1],
        propertyName);
        -> Does this mean that only the last level is checked ?
         
        I defined properties for upper levels also.

        Thanks,
        Bart
        Show
        Mondrian Importer User added a comment - {weavelink}, 09/01/2006: Logged In: YES user_id=1254631 Hi,   I added a new hierarchy to the foodmart store dimension, with the same properties defined as in the first (and default hierarchy).   In some mdx query I use the following two :   [Store].CurrentMember.Properties("Store Manager") -> Null Pointer Exception [Store.Store2].CurrentMember.Properties("Store Manager") -> works.   When addressing the first hierarchy, in combination with CurrentMember, then I see in the debugger, a DimensionCurrentMemberFunDef is filled in the funDef and the hierarchy of the return type is not filled in.   When addressing the second hierarchy, in combination with CurrentMember, then I see in the debugger, a HierarchyCurrentMemberFunDef is filled in the funDef and the hierarchy of the return type is filled in.   The PropertiesFunDef.resolve() function takes the hierarchy of the return type to get to the levels of that hierarchy and to get the properties of that level.   In the first case, the function has a null pointer exception at line 88. In PropertiesFunDef.resolve() I replaced the line                    Level[] levels = hierarchy.getLevels();   with these ones :                 Level[] levels;                 if (hierarchy == null)                 {                    // Get first and default hierarchy                    levels = args[0].getType().getDimension().getHierarchy().getLevels();                 }                 else                 {                    levels = hierarchy.getLevels();                 } And the problem is solved.   I don't know if this workaround is the ideal solution ? I have another question about PropertiesFunDef.resolve() :                   Property property = lookupProperty(                         levels[levels.length - 1], propertyName); -> Does this mean that only the last level is checked ?   I defined properties for upper levels also. Thanks, Bart
        Hide
        Mondrian Importer User added a comment -
        {jhyde}, 09/04/2006: Logged In: YES
        user_id=312935

        Fixed in change 7546. Will be in mondrian-2.2.

        The cause was fairly straightforward: if a dimension has two
        hierarchies, then a member of that dimension might be in
        either hierarchy, so we can't lookup properties at query
        prepare time. So, it was easy to fix the
        NullPointerException -- just defer type checking until runtime.

        But now the problem is that the Properties(<propName>)
        function returns a value whose type is not known until
        runtime. So I had to implement the CAST operator.

        Note that Microsoft Analysis Services borrows the
        type-conversion functions CInt, CStr etc. from Visual Basic.
        I'd rather borrow from the SQL standard, hence CAST(<expr>
        AS <type>). So mondrian isn't compatible with MSAS in this area.
        Show
        Mondrian Importer User added a comment - {jhyde}, 09/04/2006: Logged In: YES user_id=312935 Fixed in change 7546. Will be in mondrian-2.2. The cause was fairly straightforward: if a dimension has two hierarchies, then a member of that dimension might be in either hierarchy, so we can't lookup properties at query prepare time. So, it was easy to fix the NullPointerException -- just defer type checking until runtime. But now the problem is that the Properties(<propName>) function returns a value whose type is not known until runtime. So I had to implement the CAST operator. Note that Microsoft Analysis Services borrows the type-conversion functions CInt, CStr etc. from Visual Basic. I'd rather borrow from the SQL standard, hence CAST(<expr> AS <type>). So mondrian isn't compatible with MSAS in this area.

          People

          • Assignee:
            Julian Hyde
            Reporter:
            weavelink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: