conflicts¶
Find and remove rows that contain the same values in a selected column.
Note
This guide explains how to configure the conflicts instruction. To learn about another instruction, go back to the Custom scripts available in Adverity overview.
Introduction¶
Use the conflicts instruction to keep unique combinations for a given value. The instruction finds rows that share common values in a selected column but also contain non-identical values in at least one other column.
Creating a custom script transformation using the conflicts instruction¶
To create and configure a custom script using the conflicts instruction, follow these steps:
In the Instruction step, select the conflicts instruction.
To configure the custom script instruction, fill in the following fields. Required fields are marked with an asterisk (*).
- Key
Enter the name of the column to search through for duplicated values.
- Include
Enter the names of the columns to include in the instruction. If populated, only the columns entered in the Include field are parsed.
- Exclude
Enter the names of the columns to exclude from the instruction.
- Presorted
Select this field if the table has been sorted. If a table is unsorted, the transformation will take longer to complete.
- Missing
Enter the values to be ignored as conflicts. By default, an empty field is treated as a missing value.
Example 1¶
In this example, the Campaign column is searched through for duplicated values. If duplicated values exist in the other columns of the table, the duplicated rows are removed.
Transformation configuration¶
- Key
Campaign
Data table before transformation¶
Campaign |
Ad Group |
Clicks |
|---|---|---|
Brand_1 |
media |
7 |
Brand_1 |
media |
7 |
Brand_1 |
media |
18 |
Dashboard_B |
media |
5 |
Dashboard_B |
media|social |
5 |
Brand_2 |
ecommerce |
49 |
Brand_2 |
ecommerce |
49 |
Brand_2 |
ecommerce |
13 |
Data table after transformation¶
Campaign |
Ad Group |
Clicks |
|---|---|---|
Brand_1 |
media |
7 |
Brand_1 |
media |
18 |
Dashboard_B |
media |
5 |
Dashboard_B |
media|social |
5 |
Brand_2 |
ecommerce |
49 |
Brand_2 |
ecommerce |
13 |
Example 2¶
In this example, the Clicks column is excluded from the transformation. This means only the duplications in the Campaign and Ad Groups columns are searched through and removed.
Transformation configuration¶
- Key
Campaign
- Exclude
Clicks
Data table before transformation¶
Campaign |
Ad Group |
Clicks |
|---|---|---|
Brand_1 |
media |
7 |
Brand_1 |
media |
7 |
Brand_1 |
media |
18 |
Dashboard_B |
media |
5 |
Dashboard_B |
media|social |
5 |
Brand_2 |
ecommerce |
49 |
Brand_2 |
ecommerce |
49 |
Brand_2 |
ecommerce |
13 |
Data table after transformation¶
Campaign |
Ad Group |
Clicks |
|---|---|---|
Dashboard_B |
media |
5 |
Dashboard_B |
media|social |
5 |