Defining DeepSee Models
Defining Cubes
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

This chapter describes the basics of defining cubes. It includes the following topics:

Important:
DeepSee uses SQL to access data while building the cube, and also when executing detail listings. If your model refers to any class properties that are SQL reserved words, you must enable support for delimited identifiers so that DeepSee can escape the property names. For a list of reserved words, see “Reserved Words” in the Caché SQL Reference. For information on enabling support for delimited identifiers, see Identifiers in Using Caché SQL.
Defining a Cube
To define a cube:
  1. In the Architect, click New.
    The system displays a dialog box where you can enter details for the new cube.
  2. Click Cube.
  3. Enter the following information at a minimum:
    The other options are discussed later in this chapter.
    Apart from the class name of the cube class, you can edit all cube options after creating the cube.
  4. Click OK.
  5. Optionally save the cube. To do so:
    1. Click Save.
    2. Click OK.
    The system creates the class.
Another option is to use a utility to generate the cube class, as discussed in the following subsection.
Or manually create the class as described in the appendix Reference Information for Cube Classes.”
Generating the Cube Class
The class %DeepSee.WizardUtils provides a method that you can use to generate a cube class. The method is as follows:
classmethod %GenerateCubeDefinition(pSourceClass As %Library.String(MAXLEN="")="", 
                                    pCubeName As %Library.String(MAXLEN=""), 
                                    pCubeClass As %Library.String(MAXLEN="")="", 
                                    pAutoDelete As %Library.Integer = 0)
Where:
This method generates a cube definition as follows:
The method ignores transient and multidimensional properties.
Changing the Base Class for a Cube
On rare occasions, you might need to change the base class for a cube. To do so, you can do either of the following in the Architect:
After you do this, be sure to modify the source property or source expression appropriately for all parts of the model.
Possible Source Classes for a Cube
In the Architect, if you click Browse next to Source Class, the system displays a dialog box like the following:
Here you can select any class that can be used as the source of a cube in this namespace. There are three types of classes you can use this way:
Other Cube Options
In the Architect, you can specify the following options for a cube:
Adding Items to a Cube
In the Architect, there are two general ways to add items to a cube:
In both cases, the Architect adds the item and displays it in the Model Viewer. You can then make edits in the Details Area.
The following table indicates the parts of this book that discuss the different types of cube items. These sections also provide specific information on where you can drag and drop property names.
For information on ... See the chapter ...
Data Dimension Defining Dimensions, Hierarchies, and Levels
Time Dimension
Age Dimension
Hierarchy
Level
Property Defining Properties
Measure Defining Measures
Listing Defining Listings
Listing Field Defining Listing Fields
Calculated Member Defining Calculated Members
Named Set Defining Named Sets
Names for Model Elements
When you define a model element, you specify a logical name for it (the Name field in the Architect). This name is used in MDX queries and also is the default display name for that element. This section discusses requirements and suggestions for these names.
The logical names must follow these rules:
The logical names must also follow these additional rules:
Other Common Options
In the Architect, when you define a model element, you can also specify the following options for it:
Compiling and Building a Cube
In the Architect, as you develop your cubes, you will probably recompile and rebuild them multiple times. Briefly:
For more information, see the chapter Compiling and Building Cubes,” later in this book.
Opening a Cube in the Analyzer
As you develop your cubes, you should periodically use the Analyzer and examine the results. To open a cube in the Analyzer:
  1. Click DeepSee, click Analyzer, and then click Go.
    Tip:
    If the Analyzer is already open, just click the Analyzer link at the top of the page.
  2. If the left area is not currently displaying the cube you are validating, click Open and choose the cube.
For specific tips on validating levels, see Validating Your Levels,” later in this book. For general information on using the Analyzer, see Using the DeepSee Analyzer.
Deleting a Cube
To delete a cube, do the following:
  1. In the Terminal, execute the following command:
     do ##class(%DeepSee.Utils).%KillCube(cubeName)
    Where cubeName is the logical name of the cube to remove. This command removes the cube cache and indices.
  2. Also in the Terminal, delete the cube metadata, as follows:
     kill ^DeepSee.Cubes("cubes",cubeName)
    Where cubeName is the logical name of the cube to remove.
  3. Delete the cube class (and its generated classes and their data) in either of the following ways:
    Or, if you decide not to delete the cube, recompile and rebuild it.