PDA

View Full Version : Not picking up parent child hierarchies



shaunstoltz
09-24-2003, 11:31 AM
Am having problems using parent/child relationships...
.xml follows:
<?xml version="1.0"?>
<Schema name="FoodMart">
<!--
== $Id: //open/mondrian/demo/FoodMart.xml#14 $
== This software is subject to the terms of the Common Public License
== Agreement, available at the following URL:
==
http://www.opensource.org/licenses/cpl.html.
== Copyright (C) 2000-2003 Kana Software, Inc. and others.
== All Rights Reserved.
== You must accept the terms of that agreement to use this software.
==
== todo:
== 1. <CalculatedMember/>
-->

<Dimension name="FinTime">
<Hierarchy hasAll="true" allMemberName="All Periods" primaryKey="perid">
<Table name="period"/>
<Level name="Period ID" uniqueMembers="true" column="perid" parentColumn="parid" nameColumn="pernm" nullParentValue="0">
</Level>
</Hierarchy>
</Dimension>
<Dimension name="BusUnit">
<Hierarchy hasAll="true" allMemberName="All Business Units" primaryKey="bid">
<Table name="busunit"/>
<Level name="Business Unit" type="Numeric" uniqueMembers="true" column="busunitid" parentColumn="busunitpar" nameColumn="busunitnm" nullParentValue="0">
</Level>
</Hierarchy>
</Dimension>

<Cube name="Fin">
<Table name="factmndb"/>
<Dimension name="Account" foreignKey="accid">
<Hierarchy hasAll="true" allMemberName="All Accounts" primaryKey="acid">
<Table name="accmn"/>
<Level name="Account ID" uniqueMembers="true" column="acid" parentColumn="paccid" nameColumn="description" nullParentValue='0'>
</Level>
</Hierarchy>
</Dimension>
<DimensionUsage name="BusUnit" source="BusUnit" foreignKey="busunt"/>
<DimensionUsage name="FinTime" source="FinTime" foreignKey="per"/>
<Measure name="Amount" column="amt" aggregator="sum" formatString="Currency"/>
</Cube>
</Schema>
MDX query being used:
select
{[Measures].[Amount]} on columns,
{[Account].[All Accounts]} ON rows
from [Fin]
The Hierarchy for the Account dimension is flat... the parent/child relationships are not being picked up as they are in the employee dimension in the HR cube which I have working.
Any help appreciated.
Regards,
Shaun

jhyde
09-24-2003, 11:41 AM
I notice that you have used single-quotes for the nullParentValue attribute.
Check that your top-level accounts really do have their parents set to 0, not null.
Other than that, no clue.

jhyde
09-24-2003, 11:51 AM
Just noticed this tracker item:
http://sourceforge.net/tracker/index.php?func=detail&aid=784750&group_id=35302&atid=414614
It might be the same issue. I don't have time to look at it now, I'm afraid.

shaunstoltz
09-24-2003, 12:08 PM
Hi Julian, first off thanks for your time and effort today. It is appreciated.
This is the same issue I have as the traker... I will test the 100+ requirment.
I did use double quotes first but didnt work, so changed to singles.. :0)
I work extensivly with commercial olap tools and am very keen for a 'free' olap server. We have developed a nifty way of managing dimensions and parent/child hierarchies for our project implementation system and have asked one of my team to look at modifying it to help with modeling dimensions and cube for Mondrian.
Again, thanks for your help.
Regards,
Shaun

shaunstoltz
09-25-2003, 06:22 AM
Have tested the 100+ constraint, hierarchies now picking up parent/child relationships, all be it a bit raged.
Regards,
Shaun

jhyde
09-25-2003, 06:32 AM
The '100' number sounds suspiciously like the value of the mondrian.rolap.LargeDimensionThreshold parameter. If you reduce that, I suspect that parent-child behavior will work in smaller dimensions. (There may be some performance cost associated with this workaround, of course.)
Please log this issue as a bug, and list the workaround (if it works) and I will look at it when I get back.