-2

I am building a structural dimension in a data analysis software. This structure should reflect the Organizational Structure. The hierarchy is as follows:

  1. Business Unit
  2. Department
  3. Department
  4. Department (possibly more)

The departments are related in a parent/child-relationship. The data table has the following columns:

  • Business Unit
  • Business Unit (Label)
  • Department
  • Department Label
  • Parent Department
  • Parent Department Label

I just do not know how to set up this code to create the parent/child relationship while also grouping to the correct Business Unit.

I will also be using joins to link employees to the corresponding departments, which I would happily accept advice on how to do. Thanks :-)

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Halvor
  • 1

1 Answers1

0

There are many ways to achieve this, what I would have done is :

  • BusinessUnit (PK, BULabel)
  • Department (PK, BusinessUnitPK,ParentDepartmentPK, DLabel)
  • Check(BusinessUnitPK is null xor ParentDepartmentPK is null) : integrity check so that a departement "inherits" the business unit

  • Employe(PK,DepartmentPK)

Gar
  • 852
  • 13
  • 20