#18 Parent-child hierarchy is displayed incorrectly

open
nobody
None
5
2014-08-21
2005-11-01
Julian Hyde
No

Dipendra Pokhrel reports [
https://sourceforge.net/forum/message.php?msg_id=3346465 ]:

In 'JPivot pivot table by XMLA' sample of mondrian,
when I tested the following MDX query:

"
SELECT {[Time].[1997], [Time].[1998]} ON columns,
[Employees].[All Employees].[Sheri Nowmer].[Derrick
Whelply].Children ON rows FROM [HR] WHERE
([Measures].[Count])
"
I found that the Employees filter(in JPivot Navigator)
in HR cube doesn't work correctly. When I select the
'+' on "All Employees" I see one child "Sheri Nowmer"
(the boss). That's correct.
But when I select the '+' on "Sheri Nowmer" I don't see
any child employee even if "Sheri Nowmer" has 7
sub-employees.
However it is working well when the same MDX is tested
on "JPivot pivot table" sample of mondrian.
Seems this issue is related with XMLA implementation
since the same MDX query is working well on direct
jPivot with mondrian integration but does not work
while using with XMLA.

---

Gang Chen replies:

I have done raw xmla tests both on Mondrian and MS AS.

MDX:
SELECT {[Measures].[Org Salary]} ON columns,
Hierarchize(Union({[Employees].[All Employees]},
[Employees].[All
Employees].Children)) ON rows FROM HR WHERE ([Time].[1997])

Result from Mondrian (only `rows' axis):
<Axis name="Axis1">
<Tuples>
<Tuple>
<Member Hierarchy="Employees">
<UName>[Employees].[All Employees]</UName>
<Caption>All Employees</Caption>
<LName>[Employees].[(All)]</LName>
<LNum>0</LNum>
<DisplayInfo>65537</DisplayInfo>
</Member>
</Tuple>
<Tuple>
<Member Hierarchy="Employees">
<UName>[Employees].[All Employees].[Sheri Nowmer]</UName>
<Caption>Sheri Nowmer</Caption>
<LName>[Employees].[Employee Id]</LName>
<LNum>1</LNum>
<DisplayInfo>7</DisplayInfo>
</Member>
</Tuple>
</Tuples>
</Axis>

Result from MS AS (only `rows' axis):
<Axis name="Axis1">
<Tuples>
<Tuple>
<Member Hierarchy="Employees">
<UName>[Employees].[All Employees]</UName>
<Caption>All Employees</Caption>
<LName>[Employees].[(All)]</LName>
<LNum>0</LNum>
<DisplayInfo>65537</DisplayInfo>
</Member>
</Tuple>
<Tuple>
<Member Hierarchy="Employees">
<UName>[Employees].[All Employees].[Sheri Nowmer]</UName>
<Caption>Sheri Nowmer</Caption>
<LName>[Employees].[CEO]</LName>
<LNum>1</LNum>
<DisplayInfo>8</DisplayInfo>
</Member>
</Tuple>
</Tuples>
</Axis>

The values of DisplayInfo are alike, which only use the
lower 2 bytes
to indicate numbers of children. (MS AS may include the
parent in
count of children by some settings, so it's value is 8)

DisplayInfo's structure is here
http://msdn.microsoft.com/library/en-us/oledb/htm/olapaxis_rowsets.asp

I think this may be a problem in JPivot. Julian, can
you forward it to
JPrivot's lists? Thanks.

Discussion

  • Gang Chen

    Gang Chen - 2005-11-02

    Logged In: YES
    user_id=954671

    After doing some tests with MS AS, I find JPivot can render
    `+' for
    members in parent-child hierarchy for it. :(

    The big difference of two xmla services is that MS AS can
    return multi
    levels for parent-child hierarchy (the number of levels
    comes from the
    data of hierarchy), but Mondrian returns only one level for
    parent-child hierarchy (comes from the definition of schema
    file). I
    guess JPivot relys on levels for `+' rendering. If this is
    right, it
    is a serious problem.

     
  • Julian Hyde

    Julian Hyde - 2005-11-02

    Logged In: YES
    user_id=312935

    Is there anything I can do to help?

    If a particular XML/A call is implemented wrong, you could
    add a unit test to XmlaTest with input XML and desired XML
    result (prefixed '_test', of course, so it is disabled),
    check in, and hand over to me.

     
  • Gang Chen

    Gang Chen - 2005-11-03

    Logged In: YES
    user_id=954671

    As my previous guess, this is the bug for Mondrian in JPivot:

    public XMLA_Member(
    XMLA_Model model,
    String uName,
    String caption,
    XMLA_Level lev,
    boolean isCalculated) {
    /*
    ...
    */

    // Parent-child hierarchy only have one level in Mondrian,
    // so level.getChildLevel() == null is always true. Then
    // these members lose the chance to discover their
    children :(
    if (level.getChildLevel() == null || isCalculated) {
    childrenCardinality = 0;
    childrenOk = true;
    }
    }

    If I remove `level.getChildLevel() == null', JPivot can
    render `+/-', but lose the level intendation because of only
    one level in Mondrian's parent-child hierarchy :(

     
  • Julian Hyde

    Julian Hyde - 2005-11-03

    Logged In: YES
    user_id=312935

    OK, so it's a bug in JPivot. Good news (for us :).

    If someone in JPivot dev wants to take this up, I suggest
    that you introduce a method similar to
    'SchemaReader.isDrillable(Member)'. So that you can deduce
    whether a member is drillable from the client side of an
    XMLA connection, I guess we could construct DISPLAY_INFO,
    which includes the number of children.

     
  • Gang Chen

    Gang Chen - 2005-11-04

    Logged In: YES
    user_id=954671

    Sorry for the typo in previous comment.

    Children Cardinality is already in DISPLAY_INFO. And after
    changing
    if (level.getChildLevel() == null || isCalculated)
    to
    if (isCalculated)
    Expand/Collapse(`+/-') works well, but indention of levels
    is messy (actually there is no indention for levels). As I
    remember, this problem ever occured in JPivot's Mondrian
    OlapModel.

    May be this one
    http://sourceforge.net/tracker/index.php?func=detail&aid=953837&group_id=58645&atid=488472

     
  • Julian Hyde

    Julian Hyde - 2005-11-04

    Logged In: YES
    user_id=312935

    Does this happen:
    a) When running JPivot against Mondrian directly
    b) When running JPivot against Mondrian via XML/A
    c) When running JPivot against MSAS via XML/A

    If (c) doesn't work, then the bug is solely JPivot's problem
    (and is probably covered by the bug you found, bug 953837).

    Can someone on the JPivot side please step in to this
    conversation? I'm out of my league here.

     
  • brownet

    brownet - 2005-11-04

    Logged In: YES
    user_id=1277604

    As I mentioned on the Mondrian site - I am seeing this same
    problem.

    To address part of Julian's questions:
    a) No - everything works fine with direct Mondrian calls
    b) Yes - this is where the problem is being seen
    c) We don't have MSAS so I can't really answer this one for you.

    It is definitely XML/A specific - I can't tell whether it is
    Mondrian specific or not.

     
  • ygiriyap

    ygiriyap - 2009-11-24

    hi Julian,

    After going through the forum, its confirmed that this issue is still open and not fixed.

    I would like to go ahead and fix this bug.
    Can you please give some idea as to how to go about fixing this bug?
    This will give me a thrust to start with.

    Many Thanks,
    --Yash

     

Log in to post a comment.