select

Select rows in a data extract to keep using a python expression.

Introduction

Use the select enrichment to find and keep rows in a data extract for which the Python expression evaluates to true. Only the rows of the data extract that are evaluated as true are kept, all other rows are removed.

Creating the enrichment

For more information on creating an enrichment, see Using custom scripts.

Configuring the enrichment

To configure the enrichment, fill in the following fields. Required fields are marked with an asterisk (*).

Where*

Enter a python expression to use as search criteria. For example, you can enter the name of a column and a value within the column. Enter the name of the column between braces and the value to search for between quotes. For example, {column_name}=='value to search'.

Complement

Select this field to reverse the enrichment. Any rows that match the search criteria are removed and the rows that do not match the criteria are kept.

Missing

Enter a value with which to populate empty fields.

Subtable

Enter the name for a subtable that you want to contain the enriched data. The enrichment is applied to the whole data extract, then the enriched data is output into the subtable you have named here.

This subtable is a temporary table, which means it 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.

Example 1

Enrichment configuration

Where*

{Campaign} == 'Brand'

Complement

Do not select this field.

Data table before enrichment

Campaign

Ad Group

Clicks

Brand

media

7

Branding

ecommerce

3

Dashboard

brand awareness

18

Brand

ecommerce

4

Dashboard

media|social

5

Branding

media

11

Data table after enrichment

Campaign

Ad Group

Sum_Clicks

Brand

media

7

Brand

ecommerce

4

Example 2

Enrichment configuration

Where*

{Campaign} == 'Brand'

Complement

Select this field.

Data table before enrichment

Campaign

Ad Group

Clicks

Brand

media

7

Branding

ecommerce

3

Dashboard

brand awareness

18

Brand

ecommerce

4

Dashboard

media|social

5

Branding

media

11

Data table after enrichment

Campaign

Ad Group

Sum_Clicks

Branding

ecommerce

3

Dashboard

brand awareness

18

Dashboard

media|social

5

Branding

media

11