dimension bug/feature w/ multiple hierarchies

Help
2007-10-19
2013-04-29
  • Ati Rosselet
    Ati Rosselet
    2007-10-19

    Hi, we have a dimension with multiple hierarchies

    -Ledger
    o All Ledgers
    o Sales POC
    o Margin
    -Ledger
    o All Hungarian Accounts
    -Ledger
    o All International Accounts

    Logically, each hierarchy is displayed under its own tree.  The strange thing is, that if any one is selected (e.g. Intl Accounts), then the next time the dimension is opened, this hierarchy is displayed under every tree.  With a single hierarchy dimension that makes sense, since it will be a member of the hierarchy displayed, but here we have the selected items appearing under hierarchies they are not related to.  Is this a bug/feature? 

    e.g: If "All International Accounts" is selected, the next time I open the dimension, I get this:

    Ledger / Ledger / Ledger / Ledger   
    -Ledger
    + All International Accounts
    o All Ledgers
    o SalesPOC
    o Margin
    - Ledger
    + All International Accounts
    o All Hungarian Accounts
    - Ledger
    + All International Accounts
    - Ledger
    + All International Accounts
    o All Ledger.Plan Ledger Hierarchies

    If, however I don't select the  toplevel "All" item ,but instead select a single sub element, or even multiple sub trees, then this duplication does not occur. I'm assuming that there is a problem with the logic that always shows the selected members of a dimension - and with multiple hierarchies it is getting confused as to where the selected items belong... anyone else run into this, or have an idea where to look for a fix?

    Cheers
    Ati

     
    • Ati Rosselet
      Ati Rosselet
      2007-10-19

      it seems that in MondrianMemberTree the actual selected Level members (Axis) is returned with getAxes/getPositions, and added to the actual hierarchy members... Not sure yet where I can check for membership in hierarchy... or whether this is a deeper problem ... and the actual request for members does not include information about the hierarchy...  I'm getting a bit confused here.. need to dig deeper maybe.. :)

       
    • Ati Rosselet
      Ati Rosselet
      2007-10-19

      in the file: com/tonbeller/jpivot/mondrian/MondrianMemberTree.java, at line 121 - add a check around the statements to add the hierarchy members from the current query result.

                    // only add hierarchy items from the query results
                    // if they are actually in in the currently expanding hierarchy!!
                     if (mem.getMonMember().getHierarchy().equals(monHier)) {
                        if (!(mem.getMonMember().getParentMember() == null))
                          continue; // ignore, not root
                        if (!visibleRootMembers.contains(mem))
                          visibleRootMembers.add(mem);

                        // Check if the result axis contains invisible members
                        if (!aMem.contains(mem)) {
                            aMem.add(mem);
                        }
                     }

      All this fix does AFAIK, is to ensure that hierarchy members from the current query results are only added IF they are actually in the same hierarchy of the dimension as that being expanded. For dimensions with a single hierarchy this is trivial, but for multiple hierarchy dimensions this was causing the strange display duplication we were experiencing.  Does this break anything else? (so far I can't see any possible side-effects)

      Cheers
      Ati

       
      • Andreas Voss
        Andreas Voss
        2007-10-22

        Thank you for fixing this, your change sounds reasonable to mee so I have checked in the change.

        Andreas

         
        • This fix should be applied to XMLA_MemberTree as well - here is the fix:
              if (mem.getHierarchy().equals(hier)) {   
                            if (!(getParent(mem) == null))
                                continue; // ignore, not root
                       
                            if (!visibleRootMembers.contains(mem))
                                visibleRootMembers.add(mem);
                      
                            // Check if the result axis contains invisible members
                            boolean containsMember = false;
                            for (int i = 0; i < rootMembers.length; i++) {
                                if (rootMembers[i].equals(mem)) {
                                    containsMember = true;
                                    break;
                                }
                            }
                            if (!containsMember && !aCalcMem.contains(mem) && !invisibleRootMembers.contains(mem)) {
                                invisibleRootMembers.add(mem);
                            } 
                        }
                      }

           
    • dipesh
      dipesh
      2008-01-15

      Thanks for your insight. I have fixed the repetion of multi hiereachy in similar way. But is there a way to remove the repetition of the dimension name as well. For instance in above scenario can the multiple repetition of Ledger be removed.

      Thanks in advanced

      Dipesh

       
  • Has the XMLA_MemberTree fix also been implemented?

    If not this would explain the problem that I have where the All level is duplicated in the olap tree navigator.

    Also, anyone knows a company offering jpivot expertise besides pentahoo?

     
  • I confirm that the fix suggested by dpokhrel  works and fixes the bug in XMLA.

    Could this be added to the next release?