To create compound cubes, you must use Studio. To create a compound cube, do all the following:
Create a subject area with the Base cube option equal to a comma-separated list of cubes. For example, for the sample subject area CompoundCube/CompoundCube, Base cube is as follows:
Also edit the Depends On option in the Details Area on the right. For the value, specify the full package and class name of all the cube classes.
Any subject area class should always be compiled after the cube class or classes on which it is based. The Depends On setting helps control this.
In the cubes that the compound cube uses, optionally redefine the Count measure. To do so, specify the countMeasureName and (optionally) countMeasureCaption attributes in the definitions of the cubes. For example:
This change does not require rebuilding these cubes.
In the compound cube, optionally change the display names of measures names to be more specific, for use in the compound cube. For example:
<measure name="Allergy Count" displayName="Patient Allergy Count"/>
<measure name="Avg Allergy Count" displayName="Patient Avg Allergy Count"/>
<measure name="Age" displayName="Patient Age"/>
<measure name="Avg Age" displayName="Patient Avg Age"/>
<measure name="Test Score" displayName="Patient Test Score"/>
<measure name="Avg Test Score" displayName="Patient Avg Test Score"/>
<measure name="Encounter Count" displayName="Patient Encounter Count"/>
<measure name="Avg Enc Count" displayName="Patient Avg Enc Count"/>
Recompile any cube definitions that you change. Recompile the compound cube last.
In a compound cube, the available dimensions are the dimensions from the first listed cube and all formally shared dimensions. The available measures include all the measures from all the cubes.
Example Compound Cube
To see an example of a compound cube, see the class BI.Model.CompoundCube.CompoundCube. This class is defined as follows:
Class BI.Model.CompoundCube.CompoundCube Extends %DeepSee.SubjectArea
[ DependsOn = (BI.Model.CompoundCube.Patients, BI.Model.CompoundCube.Doctors,
/// This XData definition defines the SubjectArea.
XData SubjectArea [ XMLNamespace = "http://www.intersystems.com/deepsee/subjectarea" ]
<subjectArea name="CompoundCube/CompoundCube" displayName="CompoundCube/CompoundCube"
The cube CompoundCube/Patients, which is defined in BI.Model.CompoundCube.Patients defines all the dimensions.
The other cubes (CompoundCube/Doctors and CompoundCube/CityRainfall) define dimensions that are shared from the CompoundCube/Patients. Notice that not all the dimensions are defined in all the cubes. The following table shows the dimensions available in each cube:
The HomeD dimension is defined in all three cubes, so this dimension affects the measures of all three cubes. For example, the dashboard Demo Compound Cube includes this pivot table:
The Patient Count measure is defined in CompoundCube/Patients, Doctor Count measure is defined in CompoundCube/Doctors, and Avg Monthly Rainfall Inches measure is defined in CompoundCube/CityRainfall. Notice that the values are different for each measure for each city.
The same dashboard also includes a pivot table that use BirthD for rows:
Because CompoundCube/Doctors does not define the BirthD dimension, the measure Doctor Count cannot be broken out by birth decade. Notice that the Doctor Count column shows the same number in all cells; this is the total doctor count across birth decades for all patients.
Finally the Demo Compound Cube dashboard also includes a pivot table that use DoctTypeD for rows:
Because CompoundCube/CityRainfall does not define the DocTypeD dimension, the measure Avg Monthly Rainfall Inches cannot be broken out by doctor type. This measure is aggregated across all patients (by averaging, as defined in the measure).