cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
There are situations when your data needs to represent a many to many relationships such that your dimension members are at a lower grain than related facts; aka multivalued dimension.  In these cases, a single fact record should relate to multiple dimension values.  Here are a few examples from the Kimball Group.
  • Patients can have multiple diagnoses.
  • Students can have multiple majors.
  • Consumers can have multiple hobbies or interests.
  • Commercial customers can have multiple industry classifications.
  • Employees can have multiple skills or certifications.
  • Products can have multiple optional features.
  • Bank accounts can have multiple customers.
By using a bridge table, we can model a many-to-many relationship such as the following diagram.


The steps to build this model are:
  1. Keep the fact at the native grain such that each fact should relate to multiple values in the many-to-many dimension.
  2. Generate an ID for each distinct group of dimension values referenced by the fact table.
  3. Create a bridge fact table that relates the group IDs to the individual dimension members.
For a detailed description of how to build this model see the post below.  In most cases you will need to build a process that converts records to string to efficiently create the ID groups.
Once you have your underlying data in a model such as the above, the data can be brought into an ElastiCube and appropriate relationships defined.  Note that the dimension that contains the group IDs and the bridge fact table do not need to be exposed to users and may be hidden.
Here is an example an ElastiCube handling a many-to-many relationship.
And here is the data.
Now that we have the our many-to-many modeled and the cube built, we can get the results we are looking for.  For example, if we are looking for claims total by patient, then the many-to-many does not impact the results.
However, if we are looking for claims by patient diagnosis, then we will see the same claim amount applied to each diagnosis.
This same technique can be used to handle cases where you have dimensions at a granularity lower than your fact grain; multivalued dimension.
Version history
Last update:
‎03-02-2023 08:43 AM
Updated by:
Contributors
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Developers Group:

Product Feedback Forum:

Need additional support?:

Submit a Support Request

The Legal Stuff

Have a question about the Sisense Community?

Email [email protected]

Share this page: