Pentaho Analysis - Mondrian
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-1043

Hierarchize with Except sort set members differently than in Mondrian 3.2.1

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.3.0 GA (4.1.0 GA Suite Release)
    • Component/s: None
    • Labels:
      None
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.
    • QA Validation Status:
      Not Yet Validated

      Description

      When the following MDX query is executed against FoodMart database

      SELECT

      {[Measures].[Unit Sales], [Measures].[Store Sales]} ON COLUMNS,
      {Hierarchize({[Customers].[USA].Children, [Customers].[USA].[CA].Children})} ON ROWS
      FROM [Sales]

      then in resulting rows I get
      [Customers].[USA].[CA]
      [Customers].[USA].[CA].[Altadena]
      ... all CA cities ...
      [Customers].[USA].[CA].[Woodland Hills]
      [Customers].[USA].[OR]
      [Customers].[USA].[WA]

      But when modified MDX is executed which exclude [Customers].[USA].[CA] from selected set

      SELECT {[Measures].[Unit Sales], [Measures].[Store Sales]}

      ON COLUMNS,
      Hierarchize(Except(

      {[Customers].[USA].Children, [Customers].[USA].[CA].Children}

      , [Customers].[USA].[CA])) ON ROWS
      FROM [Sales]

      then resulting rows are not in correct order according to hierarchy:

      [Customers].[USA].[OR]
      [Customers].[USA].[WA]
      [Customers].[USA].[CA].[Altadena]
      ... all CA cities ...
      [Customers].[USA].[CA].[Woodland Hills]

      When the same query is executed against Mondrian 3.2.1 then you get results in correct order:

      [Customers].[USA].[CA].[Altadena]
      ... all CA cities ...
      [Customers].[USA].[CA].[Woodland Hills]
      [Customers].[USA].[OR]
      [Customers].[USA].[WA]

      It seems that Hierarchize is not working correctly in this case in Mondrian 3.3.0

        Activity

        Hide
        Raimonds Simanovskis added a comment -

        Found out workaround that if I switch Hierarchize and Except functions then I get result in correct hierarchical order:

        SELECT

        {[Measures].[Unit Sales], [Measures].[Store Sales]}

        ON COLUMNS,
        Except(Hierarchize(

        {[Customers].[USA].Children, [Customers].[USA].[CA].Children}

        ), [Customers].[USA].[CA]) ON ROWS
        FROM [Sales]

        But it still would be good to fix the issue with wrong order when using Hierarchize(Except(...)). Any pointers where to look for cause of this issue would be appreciated

        Show
        Raimonds Simanovskis added a comment - Found out workaround that if I switch Hierarchize and Except functions then I get result in correct hierarchical order: SELECT {[Measures].[Unit Sales], [Measures].[Store Sales]} ON COLUMNS, Except(Hierarchize( {[Customers].[USA].Children, [Customers].[USA].[CA].Children} ), [Customers] . [USA] . [CA] ) ON ROWS FROM [Sales] But it still would be good to fix the issue with wrong order when using Hierarchize(Except(...)). Any pointers where to look for cause of this issue would be appreciated
        Hide
        Luc Boudreau added a comment -

        I've checked that it works as expected as of revision 14836. Seems like we've fixed the issue since the release. I did uncover one bug though. The DelegatingTupleList.slice() implementation was setting an object inside of a Collections.SingletonList (which can't be done). I've created a unit test (mondrian.olap.fun.FunctionTest.testHierarchyzeExcept() ) and I'm marking this case as can't reproduce.

        Show
        Luc Boudreau added a comment - I've checked that it works as expected as of revision 14836. Seems like we've fixed the issue since the release. I did uncover one bug though. The DelegatingTupleList.slice() implementation was setting an object inside of a Collections.SingletonList (which can't be done). I've created a unit test (mondrian.olap.fun.FunctionTest.testHierarchyzeExcept() ) and I'm marking this case as can't reproduce.

          People

          • Assignee:
            Luc Boudreau
            Reporter:
            Raimonds Simanovskis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: