[Mondrian] Non collapsed AggLevel support in Mondrian

Luc Boudreau lucboudreau at gmail.com
Sun Oct 30 20:14:03 EDT 2011

Fellow mondrian developers,

Yesterday, I've checked in a nifty new feature for aggregate tables. I
called it non-collapsed AggLevel.

Before, when using a snowflake dimension with an aggregate table, you
needed to either include all the top levels keys inside of the
aggregate table, or use the AggForeignKey element. The first option
had the problem of making the aggregate table implicitly "bound" to
that particular set of keys, The second forced the use of the key at
the lowest level in the hierarchy. This was very unpractical so today
we're introducing a new way to design aggregate tables.

Non-collapsed aggregate levels are represented in your schema like so:

    <AggName name="agg_3">
      <AggFactCount column="cnt"/>
      <AggMeasure name="[Measures].[Unit Sales]" column="sls"/>
      <AggLevel name="[Time].[Year]" column="yer"/>
      <AggLevel name="[Time].[Quarter]" column="qtr"/>
      <AggLevel name="[Time].[Month]" column="mth"/>
      <AggLevel name="[Channel.Network].[Brand]" column="brn"

In the example above, the level [Channel.Network].[Brand] is mapped to
the column "brn", but its parent levels keys are not part of the
aggregation table. At runtime, Mondrian will figure out the parent
tables to join to and make sure that all the upper levels are included
as well. In a scenario where the dimension is a web of snowflake
dimension tables, this has the advantage of making the "brn" column
re-usable for each dimension or hierarchy which uses it. Better yet,
this also works with the automatic aggregate table recognizer.

If you would like more information (as well as a nice diagram), you
can get it at:


We are planning to release this feature some time in the following
weeks after some more testing and a few work iterations. If you are
interested in helping us with this new feature, feel free to contact


More information about the Mondrian mailing list