This chapter describes how to define properties. It discusses the following topics:
Time and age dimensions cannot contain properties.
To add a property to an existing level:
Click either the level or an property within that level, in the Model Viewer
This action indicates where the property is to be added:
If you click the level, the new property will be added after all the other properties in this level.
If you click a property, the new property will be added immediately before that property.
The system displays a dialog box.
Defining a Property for a List-Based Level
If the associated level is list-based, you must define the property as follows:
In the expression, refer to the %value
variable. This variable contains the value of the associated list element.
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:
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:
For the parent level (the level that contains the property), the source property or source expression of that level must evaluate to an ID.
The system assumes that (at least for this level), the source data is normalized. That is, for the level, the data is in a different table and the source table contains a link to that table.
This requirement means that, by default, the member names for this level are IDs, which is not generally suitable for your users. In this case, also configure a property of this level for use as display names for the members. This can be the same property or a different property.
Changing the Order of Properties in a Level
To change the order of properties in a level:
To move a property up in the level, click the up arrow in the row for that level.
To move a property down in the level, click the down arrow in the row for that level.
Specifying the Column Names in the Dimension Tables
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.
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):
You can use the property values as the member names, overriding the default member names defined by the level definition.
You can use the property values to specify the default sort order of the members within the level.
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.