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

This chapter describes how to define properties. It discusses the following topics:

Note:
Time and age dimensions cannot contain properties.
Adding a Property
To add a property to an existing level:
  1. Click either the level or an property within that level, in the Model Viewer.
    This action indicates where the property is to be added:
    Note:
    The order of the properties in a level is important if the properties are used to sort members. See Specifying the Sort Order for Members of a Data Level,” in the previous chapter.
  2. Click Add Element.
    The system displays a dialog box.
  3. For Enter New Item Name, type a property name.
    Note that there are reserved names for properties, unlike for other kinds of cube elements. For details, see Names for Model Elements,” earlier in this book.
  4. Click Property.
  5. Click OK.
  6. Select the property in the Model Viewer.
Alternatively, drag a class property from the Class Viewer and drop it onto a level in the Model Viewer. Then make changes if needed in the Details Area.
Also see Other Common Options,” earlier in this book.
Defining a Property for a List-Based Level
If the associated level is list-based, you must define the property as follows:
For example, consider the Allergy Severities level in the Patients cube. This level has a property that controls the sort order of the members of this level. This property (SeveritySort) is defined by the following expression:
%cube.GetSeveritySort(%value)
This executes the GetSeveritySort() method in the cube class and the allergy severity (a string) as a argument. The method returns an integer.
Specifying a Format String
In Studio, you can specify a format string, which enables you to specify the display format for the property. You can override this formatting in the Analyzer (or in manually written MDX queries). For details, see <property> in the first appendix.
Getting a Property Value at Runtime
In some cases, you can define a property so that its value is retrieved at runtime from the appropriate source table. The requirements are as follows:
Changing the Order of Properties in a Level
To change the order of properties in a level:
The order of properties in a level can affect the sort order of the members of the level. See Specifying the Sort Order for Members of a Data Level,” in the previous chapter.
Specifying the Column Names in the Dimension Tables
When you compile a cube class, DeepSee generates a fact table class and related classes for the dimensions. When you build a cube, DeepSee populates these tables, which are described in Details for the Fact and Dimension Tables.” The properties for a level are stored in the corresponding dimension table.
By default, DeepSee generates the names of the columns in the fact table, but you can specify the column names to use instead. To do so, specify a value for the Field name in level table option for each property. Take care to use unique names.
Important:
For Field name in fact table, be sure not to use an SQL reserved word. For a list of the SQL reserved words, see Reserved Words in the Caché SQL Reference. The name must start with either a letter or a percent sign (%). If the first character is %, the second character must be Z or z. For more details on restrictions, see Class Members in the appendix “Rules and Guidelines for Identifiers” in the Caché Programming Orientation Guide. Also, do not use fact or listing, in any combination of lowercase and uppercase characters.
Special Uses for Properties
By default, properties have no effect on the members of the level to which they belong. You can, however, use properties to modify the members in the following ways (which you can combine):
Tip:
Within a level, member names are not required to be unique, as noted in the section Defining Member Keys and Names,” earlier in this book. In a well-defined cube, however, each member of a given level does have a unique key. When a user creates a query in the Analyzer, DeepSee automatically uses the member keys instead of the names. The user can expand the list of members and separately drag and drop different members that have the same names. For convenience of the users, InterSystems suggests that you also add a level property whose value is the key. For such a property, simply base the property on the same source property or source expression that the level uses. The users can then display this property in order to determine the unique identifier that DeepSee uses for the member.