# Business Mapping

### ![](https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-82a409549d31b8d9fc2afc92887e9262c1cd3f24%2FIcon_TOB_data.png?alt=media)

### Generate Button

<img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-b4e50297c67885cafce4e266cd204d7710784988%2FButton_generate_green.png?alt=media" alt="" data-size="original">\
The generate button adopts to different status (green/red). If any changes are made to the queries or the business mapping, the generate button changes color to red. Before the test case can be executed, it needs to be generated by pressing the button.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-e897227bffb7bc1d155fcbf8c4db2df5c191375a%2FOMrunHelp_TestObjectData_BusiMapp01.png?alt=media" alt="OMrun test data object - business mapping overview" width="80%"><figcaption><p>OMrun test data object - business mapping overview</p></figcaption></figure>

| Color     | Description                                                                                          |
| --------- | ---------------------------------------------------------------------------------------------------- |
| **Green** | The queries A/B with the business mapping is up to date and the test case is ready to execute.       |
| **Red**   | The queries A/B with the business mapping is outdated and the test case is **not** ready to execute. |

### Business Mapping Update Types

There are two radio buttons each for two diffent functions, Update/Initial and BySequence/ByName. The buttons define how the business mapping is created (overwrite/update and sequence). The initial setting is "Update" and "By Sequence".

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-8042abd68e80e04f468b8b21c7c87f4b82de362e%2FOMrunHelp_TestObjectData_BusiMapp02.png?alt=media" alt="OMrun test data object - business mapping functions" width="50%"><figcaption><p>OMrun test data object - business mapping functions</p></figcaption></figure>

| Function    | Description                                                                                                                                       |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| Update      | The existing business mapping is not deleted. Changes applied to the query are added/inserted to the existing business mapping.                   |
| Initial     | The existing business mapping is deleted, a new business mapping based on the sequence definition is created.                                     |
| By Sequence | If the "Generate" button is pressed, a new business mapping is generated using the sequence of the attributes from the query A to map to query B. |
| By Name     | If the "Generate" button is pressed, a new business mapping is generated matching the same names of query A to query B.                           |

### Comparison Types

The comparison radio buttons "Inner", "Outer", "Left Outer" and "Right Outer" define how the comparison is conducted. The different types enable the user to select either matching keys only or to display matching and overlapping data from two different heterogeneous sources.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-1ff05ee3b60bb3633a1f75aef8f13c1f720b8046%2FOMrunHelp_TestObjectData_BusiMapp03.png?alt=media" alt="OMrun test data object - comparison types" width="50%"><figcaption><p>OMrun test data object - comparison types</p></figcaption></figure>

The two check boxes "Text Pages" and "Allow Duplicates" are special extended functions to the existing standard comparison.

| Comparison      | Description                                                                                                                                                                                                                                                         |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Inner (A/B)     | Only records with matching keys from source A and B are visible in the test results. The record content of the matching keys is compared.                                                                                                                           |
| Outer (A/B)     | All existing records from source A and B are visible. The record content of the matching keys is compared where the record content of the non matching keys is listed as overlapping results.                                                                       |
| Left Outer (A)  | All records from source A are visible. From source B only the record content of the matching keys is visible. The record content of the matching keys is compared where the record content of the non matching keys from source A is listed as overlapping results. |
| Right Outer (B) | All records from source B are visible. From source A only the record content of the matching keys is visible. The record content of the matching keys is compared where the record content of the non matching keys from source B is listed as overlapping results. |

### Mapping Grid

The business mapping helps to map data from source A to source B. The initial generated mapping is allways a 1:1 comparison between the attributes. At least one of the attributes is defined as a key. There are many additional functions available described in the section [#inner-comparison-a-b](#inner-comparison-a-b "mention") below.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-966b7f7186c4126c7864f6f37234c03dc33f06d4%2FOMrunHelp_TestObjectData_BusiMapp04.png?alt=media" alt="OMrun test data object - business mapping" width="80%"><figcaption><p>OMrun test data object - business mapping</p></figcaption></figure>

### Attribute Alias

Every available attribute on source A/B is shown in a drop down list and is selectable for an attribute mapping.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-72b33c89ff112f78c4a4cc60c8ac43bf95fb049d%2FOMrunHelp_TestObjectData_BusiMapp05.png?alt=media" alt="OMrun test data object - attribute alias A/B" width="60%"><figcaption><p>OMrun test data object - attribute alias A/B</p></figcaption></figure>

***

### Mapping Rules

Everything possible to add between the select statement and the from statement is allowed to add in the rule field. All the generated variables (e.g. @A-Type) can be used as a placeholder in other rule rows.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-01479d0a27053fd6addaa5c2c6a1380430058c3b%2FOMrunHelp_TestObjectData_BusiMapp06.png?alt=media" alt="OMrun test data object - mapping rule" width="60%"><figcaption><p>OMrun test data object - mapping rule</p></figcaption></figure>

***

### Mapping Functions

The function defines how the mapped attributes (AliasA/AliasB) are compared. There are three different funcion how the mapped attributes are compared.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-3bf8b28d898146c8a1f484706ead94b067a74b94%2FOMrunHelp_TestObjectData_BusiMapp07.png?alt=media" alt="OMrun test data object - mapping functions" width="30%"><figcaption><p>OMrun test data object - mapping functions</p></figcaption></figure>

| Function | Description                                                                                         |
| -------- | --------------------------------------------------------------------------------------------------- |
| =        | Checks if the content of both attributes is 100% identical = true                                   |
| %        | Checks if a numeric value from two attributes deviate within defined ranges (High/Low).             |
| !=       | Checks if the content of both attribute is not identical = true                                     |
| >        | Checks if numeric value of attribut A is higher as attribute B. String values always fail.          |
| >=       | Checks if numeric value of attribut A is higher or equal as attribute B. String values always fail. |
| <        | Checks if numeric value of attribut A is lower as attribute B. String values always fail.           |
| <=       | Checks if numeric value of attribut A is lower or equal as attribute B. String values always fail.  |

### Functions Low / High / Rounding

The function defines how the mapped attributes (AliasA/AliasB) are compared. The function is related with the range settings "Low" and "High".\
The attribute value from "Alias A" is rounded based on the value in "Rounding".

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-f7c082c38f32624e24a4f2c058828c6601dd9ba3%2FOMrunHelp_TestObjectData_BusiMapp08.png?alt=media" alt="OMrun test data object - functions low / high / rounding" width="50%"><figcaption><p>OMrun test data object - functions low / high / rounding</p></figcaption></figure>

| Function    | Field | Description                                                                                                                                                    |
| ----------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| =           | Low   | The value in the field is the relative min. deviation (absolute value) allowed to pass a compare if the value of "Alias B" is within range.                    |
| <, <=,>, >= | Low   | The range function do not affect the result.                                                                                                                   |
| %           | Low   | The value in the field is the relative min. deviation (percentage) allowed to pass a compare if the value of "Alias B" is within range.                        |
| !=          | Low   | The value in the field is the relative min. deviation (absolute value) defined to fail a compare even if the value of "Alias B" is not equal but within range. |
| =           | High  | The value in the field is the relative max. deviation (absolute value) allowed to pass a compare if the value of "Alias B" is within range.                    |
| <, <=,>, >= | High  | The range function do not affect the result.                                                                                                                   |
| %           | High  | The value in the field is the relative max. deviation (percentage) allowed to pass a compare if the value of "Alias B" is within range.                        |
| !=          | High  | The value in the field is the relative max. deviation (absolute value) defined to fail a compare even if the value of "Alias B" is not equal but within range. |

| Format  | Field    | Description                                                                                                                                                               |
| ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| String  | Rounding | The compare between the two attributes ends after comparing the amount of characters defined in the field. (e.g. Rounding 2 on string "Text is longer" affects "Te" only) |
| Numeric | Rounding | The compare between the two attributes is executed on the rounded numeric values based on the number defined in the field.                                                |

### Checkboxes Key / Info / Active + Remark

With the check boxes it is possible to define a key, set additional attributes as info fields and activate/deactivate attributes for the result list. For the comparison, all attributes are converted into plain string or plain number format. The matching mechanism for the keys is running on the original format. To match keys in case of different data formats, a format conversion within the queries is needed.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-efebc6120ee5b5b6f777ee11f549d1199bbc946f%2FOMrunHelp_TestObjectData_BusiMapp09.png?alt=media" alt="OMrun test data object - checkboxes key / info / active + remark" width="50%"><figcaption><p>OMrun test data object - checkboxes key / info / active + remark</p></figcaption></figure>

| Checkbox / Field | Description                                                                                                                                                                                                                                                                                            |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Key              | It is possible to define one to many keys. As a default value the first attribute is automatically defined as key. An attribute defined as key is not allowed to be marked as "Info" field at the same time. If a "Key" field is deactivated, the next active attribute is automatically set as "Key". |
| Info             | An attribute with the checkbox set as "Info" is compared and visible in the result file but does not affect the overall row result passed / failed.                                                                                                                                                    |
| Remark           | The field allows any text to store comments for the better understanding of the compare purpose.                                                                                                                                                                                                       |
| Active           | The checkbox "Active" defines whether or not the attribute is compared and visible in the result file.                                                                                                                                                                                                 |

### Test Data Source A/B

The example table contains test data from source A and source B. Some of the data does match, others containing different keys. The record for BMW does exists as a duplicate in source B.

The listed comparison examples below do show how the test results are affected with the different comparison type selections.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-f2918f6c80af165fbf7b2d341750be8f575eeb99%2FOMrunHelp_TestObjectData_BusiMapp10.gif?alt=media" alt="Overview example data" width="90%"><figcaption><p>Overview example data</p></figcaption></figure>

***

### Inner Comparison (A/B)

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-c977e804cdc4209119e35858ad8a37b9f54696e2%2FOMrunHelp_TestObjectData_BusiMapp11.png?alt=media" alt="Comparison type" width="50%"><figcaption><p>Comparison type</p></figcaption></figure>

The type "Inner" comparison compares the records with matching keys only. It shows the result of the intersection set.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-d1be8143135cac007ccdbab60815eddc2b765ba3%2FOMrunHelp_TestObjectData_BusiMapp12.gif?alt=media" alt="Intersection" width="50%"><figcaption><p>Intersection</p></figcaption></figure>

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-de738f9286fd35600a9252650b302d95426591cd%2FOMrunHelp_TestObjectData_BusiMapp13.gif?alt=media" alt="Result on data" width="90%"><figcaption><p>Result on data</p></figcaption></figure>

***

### Outer Comparison (A/B)

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-bd3bbcb226a7181ac5a25b168204ca29d88b24cd%2FOMrunHelp_TestObjectData_BusiMapp14.png?alt=media" alt="Comparison type" width="50%"><figcaption><p>Comparison type</p></figcaption></figure>

The type "Outer" comparison compares all existing records from source A/B. It shows the result of the union set.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-8e52c52b1651c2c39a9b8abd601f0e66f0ab5057%2FOMrunHelp_TestObjectData_BusiMapp15.gif?alt=media" alt="Union" width="50%"><figcaption><p>Union</p></figcaption></figure>

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-d601e7dd6a8a805c1c2818a4277bfb298102808b%2FOMrunHelp_TestObjectData_BusiMapp16.gif?alt=media" alt="Result on data" width="90%"><figcaption><p>Result on data</p></figcaption></figure>

***

### Outer Comparison (A/B) - Text Pages

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-2a443ae385bb4801189a852b5c2fe55f725f5a91%2FOMrunHelp_TestObjectData_BusiMapp17.png?alt=media" alt="Comparison type" width="80%"><figcaption><p>Comparison type</p></figcaption></figure>

The type "Outer" comparison with the special checkbox for "Text Pages" indicates that the sources under test are converted pdf documents or other text documents (converted to flat files). The documents are compared row by row (unsorted) and show the result as a union set.

**Attributs** The comparison expects in the first column always the page number (attribute "Page"), in the second column the key (normally the first few characters of a row string, attribute "TextKey") and in the third column the text of a complete row (attribute "TextContent").

**Allowed page difference** If the text to compare is the same but not expected within the same page on document A and document B, it is possible to define a high/low range of how many pages the text can be out of alignment (e.g. High = 1 means a text in document A can be found on page 2 where document B contains the same text on page 3 because of a different character style and font size).

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-8e52c52b1651c2c39a9b8abd601f0e66f0ab5057%2FOMrunHelp_TestObjectData_BusiMapp15.gif?alt=media" alt="Union" width="50%"><figcaption><p>Union</p></figcaption></figure>

**Result 1**: Compare result with text differences on the same line within the same page range.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-5192b1fac7bcabbd92a72abc9272038f07355a9d%2FOMrunHelp_TestObjectData_BusiMapp19.gif?alt=media" alt="Result 1 on data" width="80%"><figcaption><p>Result 1 on data</p></figcaption></figure>

**Result 2**: Compare result with text differences on the same line within pages out of alignment.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-d7f6502e986c31d3029eedce95e91cd9608adb32%2FOMrunHelp_TestObjectData_BusiMapp20.gif?alt=media" alt="Result 2 on data" width="80%"><figcaption><p>Result 2 on data</p></figcaption></figure>

***

### Left Outer Comparison (A)

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-6e257409ff27b369b16a271153c7c6bc360b5a5f%2FOMrunHelp_TestObjectData_BusiMapp21.png?alt=media" alt="Comparison type left outer" width="50%"><figcaption><p>Comparison type left outer</p></figcaption></figure>

The "Left Outer" comparison type does compare alle existing recordes from source A with the matching records from source B. It shows the result (Result 1) of the matching data and the overlap from source A.

### Left Outer Comparison (A) - Allow Duplicates

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-f30a6f59dc7d9b00710d7fda46f8159dca5ebae3%2FOMrunHelp_TestObjectData_BusiMapp22.png?alt=media" alt="Comparison type left outer with duplicates" width="50%"><figcaption><p>Comparison type left outer with duplicates</p></figcaption></figure>

The "Left Outer" comparison type does compare alle existing recordes from source A with the matching records from source B **including duplicates**. It shows the result (Result 2) of the matching data including duplicates and the overlap from source A.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-e3895601333b40936c76e2a88dc1e8720671c783%2FOMrunHelp_TestObjectData_BusiMapp23.gif?alt=media" alt="Left outer" width="50%"><figcaption><p>Left outer</p></figcaption></figure>

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-408127d6fc81c42de8c824624a87881c8d78e7c5%2FOMrunHelp_TestObjectData_BusiMapp24.gif?alt=media" alt="Result 1 on data" width="90%"><figcaption><p>Result 1 on data</p></figcaption></figure>

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-ce192295a79f61b75a86b6e3fd04207f45f06cc0%2FOMrunHelp_TestObjectData_BusiMapp25.gif?alt=media" alt="Result 2 on data" width="90%"><figcaption><p>Result 2 on data</p></figcaption></figure>

***

### Right Outer Comparison (B)

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-51ea7ea2761a76f22c6ac67fe5622a9115805f83%2FOMrunHelp_TestObjectData_BusiMapp26.png?alt=media" alt="Comparison type" width="50%"><figcaption><p>Comparison type</p></figcaption></figure>

The "Right Outer" comparison type does compare alle existing recordes from source B with the matching records from source A. It shows the result (Result 1) of the matching data and the overlap from source B.

### Right Outer Comparison (B) - Allow Duplicates

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-3484ebb371a2654973d04f82ca2addadcc096b22%2FOMrunHelp_TestObjectData_BusiMapp27.png?alt=media" alt="Comparison type" width="50%"><figcaption><p>Comparison type</p></figcaption></figure>

The "Right Outer" comparison type does compare alle existing recordes from source B with the matching records from source A including duplicates. It shows the result (Result 2) of the matching data including duplicates and the overlap from source B.

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-8a1e9317ee164e98ee0b309517901fca5dd6ed7b%2FOMrunHelp_TestObjectData_BusiMapp28.gif?alt=media" alt="Right outer" width="50%"><figcaption><p>Right outer</p></figcaption></figure>

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-a9ec48b193f064c5b78236df614ec64ef4230c0a%2FOMrunHelp_TestObjectData_BusiMapp29.gif?alt=media" alt="Result 1 on data" width="90%"><figcaption><p>Result 1 on data</p></figcaption></figure>

<figure><img src="https://1143774439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ooXfQ2qWGFRh6lihybt%2Fuploads%2Fgit-blob-ce75e308fd90e9f58661ca728a8ad8cd2d3e48ee%2FOMrunHelp_TestObjectData_BusiMapp30.gif?alt=media" alt="Result 2 on data" width="90%"><figcaption><p>Result 2 on data</p></figcaption></figure>
