# Managing global mappings

Before you import a data model from ERwin, you can set up the global mappings from the logical ERwin model (the entities and attributes) to the physical source database (the tables and columns). This is useful if numerous entities in your model contain the same attribute. For example, lets assume that twenty source entities contain an attribute called "BusinessKey". In the physical source tables however, this column (which also appears in twenty tables) is called "Key". Using the Global Mappings feature, you only need to define the "Key-to-BusinessKey" mapping once instead of twenty different times.

When you import from ERwin, you can then select the Use Global Mappings check box to apply these mappings. See also [Importing the model from ERwin](https://help.qlik.com/en-US/compose/December2024/Content/ComposeDWDL/Main/DW/Model/import_model_from_ERwin.htm).

You can add, edit, and remove entity and attribute mappings. If needed, you can also change the source database referenced for the tables (if you have several different sources defined).

To manage global mappings:

1. In the Model panel, from the drop-down menu in the top right, select Global Mappings.

   The Global Mappings window opens in the Tables to Entities tab.

2. Import the ERwin entities:

   1. Click Import Entities to Mappings toolbar button.

      The Import Entities window opens.

   2. In the File Path field, enter the full path to the ERwin.xml file (on the Compose Server machine) that includes the entities you want to import.

   3. Click OK.

3. Verify that Qlik Compose is using the desired source database. The database name is displayed in green at the bottom right of the toolbar.

   To select a different source database:

   1. Click Change Source Database.
   2. In the Set Source Database window, select a different database and then click OK.

4. Add new entities, edit existing entities, or remove entities as described in the following table:

   Entity management options

   | To | Do This |
   | --- | --- |
   | Add a new entity | <ol> <li>In the <span>Tables  to Entities</span> tab, click the <span>New</span> toolbar button.</li> <li> <p>Next to the <span>Entity Name</span> field, click the browse button.</p> <p>The <span>Unmapped Entities</span> window opens, listing only entities that have not yet been mapped.</p> </li> <li>Select an entity and click <span>OK</span>.</li> <li> <p>Next to the <span>Table Name</span> field, click the magnifying glass icon.</p> <p>The <span>Find Table for [Entity Name]</span> window opens for the selected entity.</p> </li> <li>From the <span>Tables</span> drop-down list on the left, select the table to map to. </li> <li> <p>Click <span>OK</span>. <span>Qlik Compose</span> populates the <span>Table Schema</span> field automatically, based on the table you selected. </p> </li> <li>Repeat these steps for all unmapped entities.</li> </ol> |
   | Edit an entity | <ol> <li>Move the mouse cursor over the entity and click the <span>Edit</span> button (pencil icon) that appears on the right. </li> <li>Make the required changes and click <span>OK</span>.</li> </ol> |
   | Delete an entity | <ol> <li>Select the entity.</li> <li>In the <span>Entities</span> toolbar, click <span>Delete</span>.</li> <li>When prompted to confirm the deletion, click <span>Yes</span>.</li> </ol> |
   | Search for an entity | In the Search look-up field, start typing. Qlik Compose only displays entities that match the search string. |

5. Add, edit, or remove attributes as described in the table below:

   Attribute management options

   | To | Do This |
   | --- | --- |
   | Add a new attribute | <ol> <li>In the <span>Columns  to Attributes</span> tab, click the <span>New</span> toolbar button.</li> <li>Provide a name and description (optional) for the attribute and the column.</li> <li>Click <span>OK</span>.</li> </ol> |
   | Search for an attribute | In the Search look-up field, start typing. Only attributes that match the search string will be displayed.<br><br>Information note<br><br>When searching for an attribute based on the attribute name, you must add the prefix "`name:`". For example, if you want to search for an attribute that contains “ar” in its name, type “`name: ar`” in the Search look-up field. |
   | Edit an attribute | <ol> <li>Move the mouse cursor over the attribute and click the <span>Edit</span> button (pencil icon) that appears on the right. </li> <li>Make the required changes and click <span>OK</span>.</li> </ol> |
   | Remove an attribute | <ol> <li>Select the attribute.</li> <li>Click the <span>Delete</span> toolbar button.</li> <li>When prompted to confirm the deletion, click <span>Yes</span>.</li> </ol> |

6. Click Close.