![]() Previous |
![]() Next |
Typically, variables are dimensioned by hierarchical objects. For example, you might have a sales variable that is dimensioned by geog, time, and product. The geog dimension might have two hierarchies (one for political divisions and another for sales regions) and each of these hierarchies could have several levels with the top level of the political geography hierarchy being All Country and the top level of the sales geography hierarchy being All Regions. Example: Defining and Populating a Hierarchical Dimension Named geog illustrates defining and populating this type of hierarchical geography dimension.
Defining and Populating a Hierarchical Dimension Named geog
DEFINE geog DIMENSION TEXT LD A dimension with two hierarchies for geography "Populate the dimension with City, State, Region, and Country values MAINTAIN geog ADD 'Boston' 'Springfield' 'Hartford' 'Mansfield' 'Montreal' 'Walla Walla' 'Portland' 'Oakland' 'San Diego' 'MA' 'CT' 'WA' 'CA' 'Quebec' 'East' 'West' 'All Regions' 'USA' 'Canada' 'All Country' "Display the values in geog REPORT geog GEOG -------------- Boston Springfield Hartford Mansfield Montreal Walla Walla Portland Oakland San Diego MA CT WA CA Quebec East West All Regions USA Canada All Country
Typically, after you define a hierarchical dimension, you define the following objects for that dimension:
hierlist dimension that lists the names of the hierarchies for the dimension. See "Hierlist Dimension" for more information and an example.
parentrel relation that defines the hierarchies. A dimension is only a hierarchical dimension when it has a parentrel defined for it. See "Parentrel Relation" for more information and an example.
levellist relation that lists the names of all of the levels of all of the hierarchies. See "Levellist Dimension" for more information and an example.
hierlevels valueset that is the values of the levels of each hierarchy. See "Hierlevels Valueset" for more information and an example.
inhier valueset or variable that identifies the values of each hierarchy. See "Inhier Valueset or Variable" for more information and examples.
levelrel relation that relates each value of the hierarchical dimension to its level in the hierarchy. See "Levelrel Relation" for more information and an example.
familyrel relation that is each hierarchical dimension value and its related values. See "Familyrel Relation" for more information and an example.
gidrel relation that is the grouping ids of each value within each hierarchy. See "Gidrel Relation" for more information and an example.