To create
ragged and unbalanced hierarchies with PROC OLAP, you specify options
that allow the procedure to skip over members of levels that have
captions with specified values. The presence of these skipped members
constitutes a ragged or unbalanced hierarchy. In a ragged hierarchy,
skipped members in a given level can have descendants; skipped members
are used to enable drill-down through empty levels. In an unbalanced
hierarchy, the skipped members do not have descendants; members are
skipped in order to create hierarchies where certain branches do extend
to all available levels.
For an example of the
creation of a ragged hierarchy, assume that a cube defines information
about sales representatives. The Geography hierarchy is defined to
have the levels Country, State, Region, and City. In this particular
sales organization, the state of Nebraska has no regions, but it does
have sales representatives in a number of cities. This ragged hierarchy
can be shown as follows:
Cube Sales Representatives
Hierarchy ...Geography...
|
Levels: |
Country ...USA...
|
State ...Montana Nebraska North Carolina...
| | | | | |
Region East West –0– Central East West
| | | | | |
City | Billings... | | | Asheville...
| | | Greenville...
Helena... | Charlotte...
|
...Council Bluffs, Lincoln, Sioux City...
The
Geography hierarchy is ragged because of the need to skip the Region
level, and because the skipped member (Nebraska) has descendants.
To create the ragged
hierarchy shown above, the Nebraska member needs to be defined with
one member at the Region level. That member needs to have a caption
that matches the value of the EMPTY_CHAR= option that is defined in
the respective DIMENSION statement.
In the resulting cube,
drilling down from Nebraska takes you directly from the State level
to the City level.
For an example of the
creation of an unbalanced hierarchy, assume that a cube named Employees
has a hierarchy named Organizations. In that hierarchy there are various
divisions, departments, and groups. As shown below, some departments
lack groups:
Cube Employees
Hierarchy ...Organizations...
|
Levels: |
Div ...R&D Sales Tech Support...
| | |
Dept Java Platform | Java Support Platform Support
| | | | |
Group | | | –0– –0–
| | |
| | Global Marketing U.S.
| |
| Hosts Performance Unit Test
|
Client Mid-Tier Server
The preceding hierarchy
is unbalanced because the Tech Support level has no descendants at
the Group level. To implement this unbalanced hierarchy, the levels
Java Support and Platform Support would have to be defined with captions
that matched the value of the EMPTY= option in their respective LEVEL
statements.
The options that implement
ragged and unbalanced hierarchies are found in the PROC OLAP statement,
DIMENSION statement, and LEVEL statement. In the PROC OLAP and DIMENSION
statements, you can specify separate caption values for character
and numeric levels using the options EMPTY_CHAR= and EMPTY_NUM=. Similarly,
the EMPTY= option of the LEVEL statement enables you to specify separate
values for each level in a hierarchy, regardless of any similar values
that were specified in preceding DIMENSION and PROC OLAP statements.
The DIMENSION and LEVEL
statements also provide the IGNORE_EMPTY option, which specifies that
any prior specifications of EMPTY_CHAR= or EMPTY_NUM= are to be ignored
for that hierarchy or level.