cutoutre#
Select and remove specific columns in a data extract using a regular expression.
Note
This guide explains how to configure the cutoutre instruction. To learn about another instruction, go back to the Custom scripts available in Adverity overview.
Introduction#
Use the cutoutre instruction to remove selected columns from a data extract. Use a regular expression to find the columns to remove.
When to use this instruction#
Use cutoutre when:
You want to remove columns whose names match a naming pattern (for example all columns starting with
tmp_or ending with_raw).You need to clean up sets of related columns without listing them individually.
If you only want to remove a handful of explicitly named columns, use cutout instead.
Creating a custom script transformation using the cutoutre instruction#
To create and configure a custom script using the cutoutre instruction, follow these steps:
In the Instructions step, select the cutoutre instruction.
To configure the custom script instruction, fill in the following fields. Required fields are marked with an asterisk (*).
- Regex*
Enter a regular expression to find the names of the columns to remove. For example, enter the regular expression
^Ad.*to remove columns with names that start withAd.- Subtable
Enter the name for a subtable that you want to use within this custom script.
A subtable is a temporary table that only exists for this custom script. You can apply additional instructions within the same custom script to the subtable. However, the subtable cannot be used in any other custom scripts.
If a subtable does not exist for the current custom script, the transformation is applied to the data extract, and the enriched data is output into the subtable. If the subtable already exists for the custom script, the subtable is used as the input for the transformation and optionally as the output.
Example#
Transformation configuration#
- Regex
^Ad.*
Data table before transformation#
Ad Campaign |
Ad Group |
Clicks |
Date |
|---|---|---|---|
Brand |
In-App |
5568 |
2022-02-11 |
Ecommerce |
In-App |
7815 |
2022-02-11 |
Growth |
Media |
6443 |
2022-02-11 |
Data table after transformation#
Clicks |
Date |
|---|---|
5568 |
2022-02-11 |
7815 |
2022-02-11 |
6443 |
2022-02-11 |