DeepSee – Less records built than rows in source table
The DeepSee TroubleShooting Guide helps you track down and fix problems occurring in your DeepSee project. A common problem is finding less records than expected in a DeepSee Cube or a related Subject Area. The DeepSee TroubleShooting Guide suggests starting your investigation by checking the following:
Build restrictions can be implemented in two ways:
- By specifying the Build restriction option in Architect > click on the cube/SA definition. This option will set the buildRestriction attribute in the Cube class visible from Studio.
Figure 1. Left: Build Restriction shown in Architect > HoleFoods Cube > Details. Right: buildRestriction attribute in Studio > HoleFoods.Cube class.
- By implementing the %OnProcessFact. This method can be used to skip building facts based on either the fact ID, the level or measure name (1) in the fact table, or if the fact is a new row. For example, the following code does not build facts with ID lower than 100 that have an amount of sale lower than 2:
The maxFacts attribute can be used in the cube definition to limit the number of facts to be built. Notice that in Architect maxFacts will appear in the popup window that opens when you Build the cube, but will not be overridden by the UI. The maxFacts attribute is a useful tool in the development phase but should be removed before deploying the cube. ￼
Figure 2. Left: maxFacts in Architect > Build popup window. Right: maxFacts attribute in Studio > HoleFoods.Cube class.
Also note that when you build your cube programmatically the fifth argument to the %DeepSee.Utils:%BuildCube method specifies the maximum number of rows in the fact table, for example:
Build errors might take place when a cube is built. The example in the picture below shows build errors as generated when building from Architect or using the %DeepSee.Utils:%BuildCube method.
Figure 3. Left: Build errors in Architect > Build popup window. Right: build errors and %PrintBuildErrors when building a cube from terminal.
More information about the errors can be found in the ^DeepSee.BuildErrors(<cubename>) global or by using the %DeepSee.Utils:%PrintBuildErrors. In the example above, a missing reference error was present:
A full description of missing reference errors is outside the scope of this post, but an explanation for the error is given in the note below (2).
Check the answer to this post for a detailed example of how to use the % DeepSee.Utils:%PrintBuildErrors method.
To find the level or measure name from the fact table I suggest using %DeepSee.Utils.%Analyze from terminal:
or the following command:
The Field Names paragraph in the documentation describes in detail how DeepSee determines the names for the measure, level, and dimension fields.
Referring to the example in Figure 3:
Building RelatedCubes/Patients generated one error. The output suggested to view the details using the %DeepSee.Utils:%PrintBuildErrors method:
The output says that the missing reference error took place for the fact with source ID = 1001 in the source table of the RelatedCubes/Patients cube (which is the DeepSee.Study.Patient class).
At this point it is a good idea to investigate the patient record. This can be done in several ways (e.g. by opening the class instance using Cache Objects, or the SQL query utility in Management Portal). Using the %SQL.Statement and %DeepSee.ResultSe classes from terminal:
The output shows that Patient with ID=1001 points to a City with ID=10. As expected, this City is present in the DeepSee_Study.City source table:
The RelatedCubes/Patients cube defines a relationship with the RelatedCubes/Cities cube. Building RelatedCubes/Patients requires the RelatedCubes/Cities cube to contain all cities referenced by each patient. As we can see, the RelatedCubes/Cities cube does not contain the referenced city Christiania:
To solve the error the RelatedCubes/Cities cube must be built first, followed by RelatedCubes/Patients one: