Skip to main content
Pentaho Documentation

Using the Shared Dimension Step in SDR

The Shared Dimension step works in much the same way as the Annotate Stream step, refining your data through the creation of dimensions which can be shared for later use. You will need to designate one annotation in the shared dimension step as the dimension key.

You can create multiple annotations on the same field, such as an attribute and a dimension key. For example, in the Shared Dimension step, you can select the field 'Year' and annotate it as a Dimension Key. You may also select the field 'Year' again to annotate as an attribute. You can also create multiple annotations to modify the same data model.

The transformation which builds a Shared Dimension should run before the Build Model job entry or in a separate job which runs before the Build Model. Here is an example transformation for a Shared Dimension.

SDRSharedDimensionWorkflow.png

After you are done with your data model, you will be ready to publish it.

Creating a Shared Dimension

This section describes how to create a Shared Dimension. 

Be sure to create one annotation to serve as the Dimension Key.

  1. In the Design tab, click the Flow folder, and then double-click the Shared Dimension step. Alternatively, you can drag the step icon on to the transformation canvas.

SharedDimensionIcon2.png

  1. Double-click the Shared Dimension icon to open the Shared Dimension dialog box.
  2. Enter a name for the step in the Step Name field.
  3. If you are basing your new dimension on an existing shared dimension, select it from the Shared Dimension Name drop-down list of available shared dimensions, or enter a new name for it.
  4. Select a source to associate your dimension from the Data Provider Step drop-down list. The following steps are valid sources:
    • Combination Lookup
    • Database Lookup
    • Dimension Lookup
    • Insert/Update
    • Table Output
    • Vertica Bulk Loader
  5. Enter a description of the shared dimension in the Description field.
  6. Select available fields for annotation.
    1. Click the Select Fields button to open the Select Fields to Annotate dialog box.
    2. Double-click the fields in the Available Fields list to add them to the Selected Fields list. For example, you might select 'Year' to annotate as your dimension key and 'Year', 'Month', and 'Week' to annotate as attributes Optionally, you can use the arrows to move one or more fields to the Selected Fields list.
    3. When finished, click OK to close the dialog box.The selected fields now display in the Annotations table featuring the following columns:
      Column Description
      Field Lists the names of the fields selected for annotation.
      Model Action Specifies which model action is being taken:
      Summary Displays a summary of that specific annotation.
  7. Now you can create annotations for the selected fields.
    1. To annotate a field, double-click it in the Annotations sectionThe Annotate dialog box appears for the selected field. Optionally, you can select the select the field in the Annotations table and then select the Edit (pencil) icon in the upper-right corner.
    2. In the Actions field, click the drop-down arrow to select one of the following actions. (For help on selecting values, select the topic link beside each action.)
    3. You can use the Previous and Next buttons to navigate through the fields. When finished, click OK to continue or Cancel to close the dialog box without saving your annotations.

You can remove a field from the Annotations section by selecting it in the table and then clicking the Delete ('X') icon in the upper-right corner.

  1. Click Apply to save changes you made to an annotation. Click OK to continue or Cancel to close the dialog box.

This is an example of the Shared Dimensions dialog box.

SharedDimension.png

Creating a Dimension Key

To use a shared dimension, you will need to designate one annotation in the Shared Dimension step as the dimension key. Since you can create multiple annotations on the same field, you can use a selected field as an annotation and as the dimension key. For example, you might want to create an attribute and a dimension key on the field 'Year' in your time dimension.

  1. If you haven't done so already, complete steps 1-8 of Creating a Shared Dimension.
  2. Select Create Dimension Key from the Actions menu. The Name - Value table auto-populates with the Dimension attribute.
  3. Enter or select a dimension in the Value field for Dimension. The selected field will be used as the key for this dimension.
  4. Click OK to finish or click Cancel to exit.

Dimension_Key.PNG

You can use a single field more than once, so you will be able to use the field you selected here for both the key and to create annotations.