Model Mapping in Present Pro

If you want to create interactions between items (visuals, slicers, dynamic content, or custom formulations) from different models, you need to either ensure that the two models have the same structure, naming, and so on or create a mapping so Pyramid knows that field X in model A is the same as field Y in model B. That is, the hierarchies and member elements that are used as a filter must exist in the data model of the target visualization for interactions between different models to work. Otherwise, when the visual is used as a filter at runtime, you will receive an error message.

The following videos demonstrate the creation of cross-model mappings:

When might you need Model Mapping ?

If the corresponding hierarchies and member elements are identically labeled in both data models, then you can create an interaction as usual. However, if the corresponding hierarchies or member elements are not identically labeled in each data model, then it is necessary to create a model mapping.

The Model Mapping wizard maps the corresponding hierarchies or member elements between the two data models, allowing the user to create functioning interactions between them.

For example, Model 1 contains a date hierarchy called Date, while Model 2's date hierarchy is called dateKey. If you add a Product Sales visual to your presentation from Model 1, and a dateKey slicer from model 2, you will receive an error when you launch the presentation at runtime. To enable the interaction from the dateKey slicer to the Product Sales chart and avoid the error, you need to configure a new model mapping that tells Pyramid that the two differently labeled hierarchies are, in fact, the same.

Create a Model Mapping

From the Presentation ribbon:

  1. Click Model Mapping (yellow arrow, above).
  2. The Model Mapping wizard opens.

  3. Click the blue plus to create a new model mapping.
  4. A new mapping is created with a default name (green arrow, above).

  5. From the Settings panel, specify a name for mapping (Title) and select the two models to be mapped. Note: The selection order is not important.
  6. The Map Hierarchies panel opens.

  7. For each hierarchy that you want to create a mapping for:
    1. Click the blue plus in the Map Hierarchies header to create a new mapping row.
    2. Specify the Settings for your mapping:
      1. Select a hierarchy from the drop-down under First Model.
      2. Select the hierarchy that the preceding hierarchy should map to under Second Model.
      3. Determine whether to Ignore Unmapped Hierarchies. You should select this option where there are similar hierarchies that don't have cross-model interactions, so don't need to be mapped.
    3. From the Map Members panel, select the mapping type:
      • Simple: If the hierarchies are labeled differently, but the member elements are labeled identically, choose Simple and select the hierarchy name type (either Unique Name or Caption).
        You would do this, for example, if the list of countries in Model 1 is in a hierarchy called Countries and the list of countries in Model 2 is called Locations, but the members are an identical list of English language country names.
      • Advanced: If the member elements are not identically labeled, choose Advanced and configure the dynamic functions required to map the differently labeled hierarchy members.
        You would do this, for example, if the list of countries in model 1 are English language country names but in Model 2 the same countries are abbreviations or ISO country codes.
    4. Once you have defined your mappings, click Apply to save your changes.
    5. Test your mapping. It is always recommended that you perform some tests by creating some cross-model interactions between your visuals, launching the presentation at runtime (F2), and checking that your new mappings behave as expected.
  • Click here for a detailed example of a Simple mapping
  • Click here for a detailed example of an Advanced mapping

Model Mapping wizard

Mapping

Mapping panel buttons

If you want to replicate the same model mapping across multiple presentations or publications, use the copy and paste functions above the Mapping list:

  • Copy All: (yellow arrow above) Copy all model mappings to your clipboard. You can use this functionality to copy all mappings to another presentation or publication.
  • Paste: (blue arrow) Paste any model mappings from your clipboard into the Model Mapping panel of another presentation or publication. This option is only enabled if you have copied one or all mappings to clipboard.

To create a new mapping, click the Plus (+) icon (green arrow).

Mapping context menu

Open the context menu of a specified model mapping listing (brown arrow) to:

  • Copy: Copy the selected mapping to clipboard, and then paste it into the Model Mapping panel of another presentation.
  • Delete: Delete the mapping.

Settings

This panel is created when you create a new mapping. The panel includes:

  • Title: The title for the mapping.
  • First Model and Second Model: The models that are mapped in any order.
  • Ignore Unmapped Hierarchies: Select this checkbox if your models contain similar, but not identical, hierarchies that do not require mapping. For example, both models contain state listings but use a different convention to name the states in each case, but these do not need to be mapped as there is no interaction. Selecting this option stops you from receiving an error when applying interactions from the mapped models.

Map Hierarchies

Select the hierarchies that you want to create a mapping between:

  • To create a new mapping, click the Plus (+) icon (purple arrow).
  • Select the hierarchies that you want to map from the First Model and Second Model drop-downs.

Note: You can add multiple hierarchy mappings here. Each hierarchy mapping should contain the two corresponding hierarchies from each of the given models.

Map Members

Simple

If Simple is selected, select the identifiers to use for the mapping:

  • Unique name: Use the member element path within the data model in the form [Dimension].[Hierarchy].[Member]. The unique name of the Bikes member element, for example, is [Products].[Product Category].[Bikes].
  • Caption: Use the caption (the member element's label). The caption for the Bikes member element is Bikes.

Advanced

If Advanced is selected, the Map Members panel is updated to include the Advanced model mapping tools. The two panels show the two formulas that should be used to enable interactions between the two models:

  • Use the First Model -> Second Model panel to write the formula that enables interactions from the first model to the second model.
  • Use the Second Model -> First Model: panel to write the formula that enables interactions from the second model to the first model.

  • Click Designer to open the Map Members Designer for the relevant formula:

  • Use the Functions and Hierarchies tabs to view and select functions and hierarchies to include in your formula. Note: You can use the search option (blue arrow) to search through these trees, hover your cursor over the function names to see more information, and double-click nodes to copy them into the editor.
  • Once your formula is complete, select a member from the drop-down (yellow arrow) and click Test (green arrow) to check that it returns the expected member in the Result Preview panel (purple arrow).
  • Click OK to save your formula and close the designer.
Function libraries
  • Click here to see the available PQL Action library
  • Click here to see the common PQL library

Example: Mapping Types

There are two types of model mapping: simple and advanced. The type that you need to configure depends on the differences between the hierarchies being mapped.

Simple Model Mapping

If the hierarchies are labeled differently, but the member elements are labeled identically, then you should create a Simple model mapping. You would do this, for example, if the list of countries in Model 1 is in a hierarchy called Countries and the list of countries in Model 2 is called Locations, but the members are an identical list of English language country names.

Example: Different hierarchy names, identical member names

The following table shows an example where member names are shared, but not hierarchy names:

 

Model 1

Model 2

Hierarchy Name:

Country

Location

Member Names:

 

 

 

 

Australia

Australia

United States

United States

Canada

Canada

France

France

Germany

Germany

Advanced Model Mapping

Advanced Mapping is required to map the member elements within two hierarchies, if the member elements are not identically labeled. In this case, the Advanced option must be selected in order to configure the dynamic functions required to map the differently labeled hierarchy members.

Example: Member elements not identically named

The following table shows an example where hierarchy names are shared, but not member names:

 

Model 1

Model 2

Hierarchy Name:

Country

Country

Member Names:

 

 

 

 

 

Australia

AUS

United States

USA

Canada

CAN

United Kingdom

UK

France

FRA

Germany

GER