concept hanger dimension in category mondrian

appears as: hanger dimension, hger dimensions, hger dimension
Mondrian in Action

This is an excerpt from Manning's book Mondrian in Action.

There are also some new, advanced concepts that will allow you to model richer kinds of data. For example, a parent-child hierarchy would allow you to model the organizational structure of your sales organization, and by using a hanger dimension you could compare target sales with actual sales, starting with each salesperson and propagating to each group in the sales organization. Using a calculation, you could project the sales for the current quarter based on sales over the last few weeks, and using another calculation, you could compare the performance of any salesperson with the top five salespeople in their region.

Using hanger dimensions to allow calculation on all dimensions

If a calculated member can’t intersect its own dimension, how can you create a calculated member that can intersect [Customers] as well as all other dimensions? The solution is to move [Top 10] into its own dimension, a dimension reserved for calculations. This kind of dimension is called a hanger dimension.

To define a hanger dimension, specify hanger='true' in the dimension definition, and define an attribute. You don’t need to map that attribute to any tables or columns; in fact, Mondrian won’t let you. Nor will it let you create a ForeignKeyLink to join the dimension to the measure group’s fact table. A hanger dimension is disconnected from the star schema; it just hangs out on its own.

Hanger dimensions also have other uses. You can use them for the “budget versus actual” comparison commonly used by accountants. Create a [Budget vs Actual] hanger dimension with two members, [Budget] and [Actual], and make your measures into formulas that redirect to different base measures (maybe in different measure groups) depending on which is current. For example, the [Sales] measure would be a calculation:

Iif([Budget vs Actual].CurrentMember Is [Budget vs Actual].[Budget],
    [Measures].[Budget Sales],
    [Measures].[Actual Sales])

You can also use a hanger dimension to create a parameter with a fixed set of values. For instance, when determining investment strategy, you might create an [Interest Rate] dimension with values [2%], [3%], and [4%]. Then you could use those values in other calculations. In many UIs, if you include this dimension in the slicer, the UI will present the values in a drop-down list. If you include the hanger dimension on an axis, you can compare scenarios with different interest rates side by side.

Lastly, Mondrian uses hanger dimensions to implement writeback. The system-generated [Scenario] dimension is, behind the scenes, a hanger dimension. (Scenarios and what-if analysis are described in section 11.2).