Skip to main content

Defining the Source Values for a Dimension or Level

Defining the Source Values for a Dimension or Level

Each level must have a specified source value. You can specify the source values within the dimension or within the level. Typically:

  • For data dimensions, you specify the source values within the level.

  • For time and age dimensions, you specify the source values within the dimension.

  • For NLP dimensions, see Using Text Analytics in Cubes. NLP dimensions do not use the mechanism described here.

To specify a source value in the Architect:

  1. Select the dimension or the level in the Model Viewer.

  2. In the Details Area, specify a value for one of the following:

    • Property — Specify the property name relative to the base class used by the cube; you can use dot syntax to refer to properties of properties. For example:

      Age
      

      For another example:

      HomeCity.PostalCode
      

      The property must have a projection to SQL.

      Also, you can refer to an object-valued property. When you do so, the numeric ID of the object is used as the source value.

      You cannot directly use a stream property (to use such a property, create an expression that returns the contents of the stream or a selected part of the contents).

    • Expression — Specify an ObjectScript expression on which the level is based. For example:

      ##class(Cubes.StudyPatients).GetFavoriteColor(%source.PatientID)
      

      This expression is evaluated when the cube is built. For details, see the next section.

You can enter values into the Property and Expression fields in any of the following ways:

  • By dragging a class property from the Class Viewer and dropping it into the field.

    The property that you drag and drop replaces any existing contents of the field.

  • By clicking the Search button .

    • For Property, the system then displays a dialog box that shows the properties of this class. Click a property and then click OK.

    • For Expression, the system then displays a dialog box with a larger field you can type into. Type an expression and then click OK.

  • By directly editing the value in the field.

The information on this section and in the next section also applies to level properties and to measures, which also require source values of some form.

Specifying a Source Value when Using a Data Connector

If the cube is based on a data connector, note the following restrictions:

  • Specify the Property option but not the Expression option.

  • You cannot use dot syntax, because none of the properties of the data connector are object references.

For information on creating data connectors, see Defining Data Connectors.

FeedbackOpens in a new tab