Single-Dimension Crosstab
Context
When you operate Multiple Aggregation Trees within a single dimension, you may want to aggregate data values by combinations of those aggregation trees.
When you set up multiple member trees within a dimension, you can aggregate along each member tree, but whether you can cross-tabulate between member trees is a separate matter.
If the Store dimension has one member tree by region and another by store format, the former can produce "Tokai Region Total" and the latter "Street-Front Stores Total." However, "Street-Front Stores Total in the Tokai Region" cannot be calculated, because neither member tree contains a member corresponding to that grouping.
To deal with this, you could set up a member tree with an aggregated member corresponding to "Street-Front Stores Total in the Tokai Region," but that is not the best solution. With this design, it is difficult to display street-front store totals side by side by region, and such member trees tend to become complex and hard to maintain.
Problem
When a single dimension has multiple member trees, we want to cross-tabulate between those member trees. In the example above, we want to treat region and store format as separate perspectives and display the data in the form of a crosstab.
Forces
-
Ease of member tree maintenance: Member trees by region and by store format already exist, so we would rather avoid adding yet another member tree by region × store format.
-
No data copying: You could create a copy of the Store dimension, create a ledger that uses two dimensions, Store (for aggregation by region) and Store (for aggregation by store format), and then copy data into it from the original ledger that uses only the Store dimension. The destination ledger would then allow cross-tabulation between the two Store dimensions. However, this requires a data copy process: depending on the data volume, the transfer can take time, and if someone forgets to run it, the figures in the two ledgers no longer match. We would rather do without data copying if possible.
Solution
Using the fusion_place mechanism called "View Ledger," you can cross-tabulate within the same dimension.
For details, see the Q&A article "How to Cross-Tabulate."
Consequences
Benefits
-
Ease of member tree maintenance: With a View Ledger, you can cross-tabulate between the original dimension and a dimension that borrows its contents, so there is no need to set up a member tree for cross-tabulation.
-
No data copying: A View Ledger holds no data of its own; it simply re-aggregates the data of the original ledger (called the Base Ledger) in real time. Therefore, no data copy process is needed.
Related Patterns
Preceding Patterns
This pattern presupposes that Multiple Aggregation Trees has been applied.