Previous
Previous
 
Next
Next

Familyrel Relation

The familyrel relation is a relation between the hierarchical dimension and the levellist and hierlist dimensions that provides the full parentage of each dimension member in the hierarchy.

Example: Defining and Populating a familyrel Relation named geog_familyrel illustrates defining and populating this type of relation.

Defining and Populating a familyrel Relation named geog_familyrel

"Define the relation 
DEFINE geog_familyrel RELATION geog <geog geog_levellist geog_hierlist>
LD FEATURES Family/Ancestry structure for the geog dimension
 
"Populate the relation using the HIERHEIGHT command 
HIERHEIGHT geog_parentrel INTO geog_familyrel USING geog_levelrel
 
"Display the values of the familyrel relation
"First the values for the Political_Geog hierarchy are displayed
"Then the values for the Sales_Geog hierarchy
REPORT DOWN geog W 12 geog_familyrel
 
GEOG_HIERLIST: Political_Geog
               -------------------------------GEOG_FAMILYREL--------------------------------
               -------------------------------GEOG_LEVELLIST--------------------------------
GEOG            All Country  Country    All Regions     Region     State-Prov      City
-------------- ------------ ------------ ------------ ------------ ------------ ------------
Boston         All Country  USA          NA           NA           MA           Boston
Springfield    All Country  USA          NA           NA           MA           Springfield
Hartford       All Country  USA          NA           NA           CT           Hartford
Mansfield      All Country  USA          NA           NA           CT           Mansfield
Montreal       All Country  Canada       NA           NA           Quebec       Montreal
Walla Walla    All Country  USA          NA           NA           WA           Walla Walla
Portland       All Country  USA          NA           NA           WA           Portland
Oakland        All Country  USA          NA           NA           CA           Oakland
San Diego      All Country  USA          NA           NA           CA           San Diego
MA             All Country  USA          NA           NA           MA           NA
CT             All Country  USA          NA           NA           CT           NA
WA             All Country  USA          NA           NA           WA           NA
CA             All Country  USA          NA           NA           CA           NA
Quebec         All          Canada       NA           NA           Quebec       NA
               Countries
East           NA           NA           NA           NA           NA           NA
West           NA           NA           NA           NA           NA           NA
All Regions    NA           NA           NA           NA           NA           NA
USA            All Country  USA          NA           NA           NA           NA
Canada         All Country  Canada       NA           NA           NA           NA
All Country    All Country  NA           NA           NA           NA           NA
 
GEOG_HIERLIST: Sales_Geog
               -------------------------------GEOG_FAMILYREL--------------------------------
               -------------------------------GEOG_LEVELLIST--------------------------------
GEOG            All Country Country    All Regions     Region     State-Prov      City
-------------- ------------ ------------ ------------ ------------ ------------ ------------
Boston         NA           NA           All Regions  East         MA           Boston
Springfield    NA           NA           All Regions  East         MA           Springfield
Hartford       NA           NA           All Regions  East         CT           Hartford
Mansfield      NA           NA           All Regions  East         CT           Mansfield
Montreal       NA           NA           All Regions  East         Quebec       Montreal
Walla Walla    NA           NA           All Regions  West         WA           Walla Walla
Portland       NA           NA           All Regions  West         WA           Portland
Oakland        NA           NA           All Regions  West         CA           Oakland
San Diego      NA           NA           All Regions  West         CA           San Diego
MA             NA           NA           All Regions  East         MA           NA
CT             NA           NA           All Regions  East         CT           NA
WA             NA           NA           All Regions  West         WA           NA
CA             NA           NA           All Regions  West         CA           NA
Quebec         NA           NA           All Regions  East         Quebec       NA
East           NA           NA           All Regions  East         NA           NA
West           NA           NA           All Regions  West         NA           NA
All Regions    NA           NA           All Regions  NA           NA           NA
USA            NA           NA           NA           NA           NA           NA
Canada         NA           NA           NA           NA           NA           NA
All Country    NA           NA           NA           NA           NA           NA