Check multiple keys
Function and purpose of the operation¶
The Check multiple keys operation verifies whether there are duplicate rows in the target dataset based on the user-defined keys.
In order to define the keys to be taken into account for finding duplicate rows, it is necessary to access the Key Fields link.
Note: Key fields are not mandatory. If not defined, all user fields in the target dataset will be considered as keys.
Operation behaviour¶
The following scenarios may occur during execution:
- No duplicate rows: the operation is completed successfully.
- Duplicate rows detected: the system generates a warning.
The audit shows:
- an error message
- the detail of the first 10 duplicate rows in the dataset
- the number of occurrences for each row
Execution from cockpit¶
If the DTP is launched from the cockpit and there are duplicate rows, an anomaly report file is created. For further details see DTP Report.
In the detected anomalies, there will be as many key combinations that have generated duplicates as there are occurrences.
Example 1: no key field defined
Target Dataset¶
| PRODUCT | PRICE | VALUE |
|---|---|---|
| Prod 01 | 3 | 15 |
| Prod 01 | 3 | 15 |
| Prod 02 | 5 | 20 |
¶
The Check Multiple Keys operation restores an anomaly:
¶
| PRODUCT | PRICE | VALUE | OCCURRENCES |
|---|---|---|---|
| Prod 01 | 3 | 15 | 2 |
Example 2: a defined key field
Target Dataset¶
| PRODUCT | PRICE | VALUE |
|---|---|---|
| Prod 01 | 3 | 15 |
| Prod 01 | 4 | 21 |
| Prod 02 | 5 | 20 |
¶
On the Key Fields page, the PRODUCT field was specified as the key.
Duplicate rows will then be selected according to the values in the PRODUCT field.
The Check Multiple Keys operation returns an anomaly:
¶
| PRODUCT | OCCURRENCES |
|---|---|
| Prod 01 | 2 |