#18 Parent-child hierarchy is displayed incorrectly

Julian Hyde

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
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
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.

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

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

Result from MS AS (only `rows' axis):
<Axis name="Axis1">
<Member Hierarchy="Employees">
<UName>[Employees].[All Employees]</UName>
<Caption>All Employees</Caption>
<Member Hierarchy="Employees">
<UName>[Employees].[All Employees].[Sheri Nowmer]</UName>
<Caption>Sheri Nowmer</Caption>

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

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


  • Gang Chen

    Gang Chen - 2005-11-02

    Logged In: YES

    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

    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

    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

    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

    Sorry for the typo in previous comment.

    Children Cardinality is already in DISPLAY_INFO. And after
    if (level.getChildLevel() == null || isCalculated)
    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

    May be this one

  • Julian Hyde

    Julian Hyde - 2005-11-04

    Logged In: YES

    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

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

    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,


Log in to post a comment.