By Evan Schmidt
This article describes how to enable a dimension member to be classified multiple times or given multiple tags. This data structure can be built by linking many-to-many relationships together.
The scenario, described by the data below, show a dimension where one attribute (e.g. “Bob” a sales person) is described by multiple members of the “Expertise” dimension (e.g. his 3 areas of expertise).
For example a sales person might have multiple areas of expertise:
Sales Person |
Expertise |
Bob |
Art History |
Bob |
Modern Art |
Bob |
Local Art |
Nancy |
Modern Art |
Now “Expertise” becomes a new dimension and the table above is the “Sales Person Expertise Bridge” table.
The dimension usage will look like this:
Fact: Dimension: |
Trans. |
||
Regular usage |
Regular usage |
None |
|
Regular usage |
Regular Usage |
||
Regular Usage |
The report will show the total revenue driven by people who have a given area of expertise:
Expertise |
Distinct Qty |
Distinct Rev |
Art History |
3 |
25,000 |
Local Art |
3 |
25,000 |
Modern Art |
4 |
75,000 |
Total |
8 |
85,000 |
At run time the server looks at the dimension usage of the "Expertise" dimension in the "Transaction" fact table and finds the dimension usage is sourced from the "Transactions Sales Person Bridge". So then server then looks at the dimension usage for the "Expertise" dimension in the "Transactions Sales Person Bridge" and finds the dimension usage is sourced from the "Sales Person Expertise Bridge". Then the serer finds the Regular Usage between "Expertise" and the "Sales Person Expertise Bridge" and so it can generate the data by joining the fact tables based on the common dimensions.
Notice how Trent’s sale is missing. This is because Trent dos not have an area of expertise.
It might be perfectly acceptable for the report to appear this way. If this missing transaction is not acceptable there are several ways to deal with it. The next article will discuss my preferred method.