Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hierarchies on single tables

Status
Not open for further replies.

suzreid

Technical User
Joined
Sep 26, 2000
Messages
59
Location
GB
I have a table that holds all my organisation hierarchy and I want to split the table in to classes

Example of table
OrgID ParentID Level Name
1 1 0 Unit1
2 1 1 Unit2
3 1 1 Unit3
4 2 2 Unit4
5 2 2 Unit5
6 4 3 Unit6

I would like to create classes for each of the level that will hold the OrgID and the Name as objects so that if I create a hierarchy using the classes I would be able to drill from level0 all the way to level3

I would expect Level0 class to have Unit1, Level1 to have Unit2 and Unit3 etc.

Any help would be gratefully received.
Suz
 
You really need to flatten our the hierarchy or you need to build aliases for each level.

There are limitations to each solution. The problem with the alias solution is that unbalanced hierarchies are a problem.

Flattening out the hierarchy is the easiest solution. Steve Krandel
BASE Consulting Group
 
Hi,
first is the dept of the hierarchy is constant. for example always 3 or 2.
If the answer is no then how are you going to create static class hierarchy in the designer.
But if u still want to go ahead you will have to use alias for each level and embedded where clause at each object in the class hierarchy so that only that level object are pulled.
If you are ready to restructure your database table then kimball has something for you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top