Skip to content

Hierarchies#

A hierarchy chains dimensions in levels: Zone › Province › Municipality, Family › Subfamily. Users see it as a tree in the segmentation editor (they choose a whole zone or only some provinces) and go down from one level to another in cubes and charts. In the metadata, each level is a dimension of type Hierarchy of the same fact table, with its auxiliary table and its upper level.

Before you start#

  • You need Metadata administration.
  • Each level needs its auxiliary table, with the codes and descriptions of that level (see Auxiliary tables).
  • The fact table has to have the columns of all the levels.

Cumulative keys#

The rule of a hierarchy is that the columns of each level begin with those of its upper level. This way, the code of a level also identifies its parent, even if codes repeat under different parents (province 01 of two zones, subfamily 10 of two families).

Cumulative keys of a hierarchy Hierarchy Zona, Provincia and Municipio: the columns of each level begin with those of the level above (COD_ZONA, then COD_PROVINCIA and then COD_MUNICIPIO) and each level has its auxiliary table. level above level above auxiliary table auxiliary table auxiliary table Zona Columns: COD_ZONA AUX_ZONAS Provincia Columns: COD_ZONA + COD_PROVINCIA AUX_PROVINCIAS Municipio Columns: COD_ZONA + COD_PROVINCIA + COD_MUNICIPIO AUX_MUNICIPIOS the same columns as the level above, in the same order the level's own column
Cumulative keys of a hierarchy Hierarchy Zona, Provincia and Municipio: the columns of each level begin with those of the level above (COD_ZONA, then COD_PROVINCIA and then COD_MUNICIPIO) and each level has its auxiliary table. level above level above auxiliary table auxiliary table auxiliary table Zona Columns: COD_ZONA AUX_ZONAS Provincia Columns: COD_ZONA + COD_PROVINCIA AUX_PROVINCIAS Municipio Columns: COD_ZONA + COD_PROVINCIA + COD_MUNICIPIO AUX_MUNICIPIOS the same columns as the level above, in the same order the level's own column
Cumulative keys of a hierarchy View full size View full size

The demonstration's example, with the CLIENTES fact table and three auxiliary tables:

Level Auxiliary table Dimension columns Join with the auxiliary table Description
Zona (zone) AUX_ZONAS COD_ZONA COD_ZONA DESC_ZONA
Provincia (province) AUX_PROVINCIAS COD_ZONA, COD_PROVINCIA COD_ZONA, COD_PROVINCIA DESC_PROVINCIA
Municipio (municipality) AUX_MUNICIPIOS COD_ZONA, COD_PROVINCIA, COD_MUNICIPIO COD_ZONA, COD_PROVINCIA, COD_MUNICIPIO DESC_MUNICIPIO

If the fact table only has the code of the lowest level (for example, only the municipality), add to the fact table the columns of the upper levels (with a database view, if needed) so that each level has its own.

Build a hierarchy#

  1. Create or adjust one dimension per level in the same fact table, all of type Hierarchy (see Dimensions).
  2. In each one, in Columns and function, set the level's columns in order: first those of the upper level, then its own.
  3. In Lookup, choose its auxiliary table and pair each column with that of the auxiliary table in Join with “…”. Choose the Description column and the Order of the values.
  4. If the auxiliary table has more columns than those forming the level, check in Hierarchy columns those that form it. With none checked, they are those of the join.
  5. Save each dimension with Save changes.
  6. Chain the levels: in the second-level dimension, in the Hierarchy section, choose its Upper level; in the third one, the second. Save.

They are also chained in the Structure tree: drag a dimension onto the one that will be its upper level. The tree confirms it: ““Municipio” is now a level of “Provincia”.” If the dimension has unsaved changes in its panel, save or discard them before dropping it.

The Hierarchy section of the panel shows the whole chain and, if it has them, its Lower levels.

The panel of the Provincia dimension of Clientes with its Hierarchy section and the chain Zona › ProvinciaThe panel of the Provincia dimension of Clientes with its Hierarchy section and the chain Zona › Provincia
The panel of the Provincia dimension of Clientes with its Hierarchy section and the chain Zona › Provincia

What Upper level offers#

Upper level only offers dimensions of type Hierarchy of the same table whose columns are the beginning of its own. If it offers none, the panel says so: “No hierarchy of “Clientes” has columns that are the beginning of its own: this dimension is the first level.” Then review the order of the columns.

A level can have several lower levels: for example, the customer's province and the delivery province under the same zone. Each level is queried with its own columns, so two lower levels never disagree with their parent.

How users see it#

  • In the presentation tree the first level is placed: the others are seen inside it and move with it. A lower level is not placed separately (see Presentation tree).
  • In the segmentation editor, the hierarchy is a tree of checkboxes: choosing a zone chooses all its provinces; you can choose only a part.
  • In a cube, the hierarchy expands from one level to the next.

Hierarchies whose auxiliary table is a fact table#

If the auxiliary table of a level is also a fact table, the Filter on the fact table checkbox of its Lookup section makes it be read from that table when the query does not reach its own. See Dimensions.

Ranges#

In Empowerment Center 7 a field of a cube could be grouped by the range filters of its segmentation (the “range level”). In ECenter 8.0 that is done with a grouping by ranges: a derived dimension with buckets such as “Up to €1,000”, “From €1,000 to €3,000” and “Other”, which is created in Groupings and used like any dimension, also above its dimension as if it were an upper level. The EC7 importer translates the range level into a grouping by ranges when its filters are intervals that do not overlap. See Groupings.

See also#