selectnotin

Remove rows with a value that matches any of a list of values you enter.

This guide explains how to configure the selectnotin instruction. To learn about another instruction, go back to the Available custom script instructions overview.

Introduction

Use the selectnotin instruction to find and keep rows in a data extract. Only the rows of the data extract that are not an exact match of the values entered in the enrichment configuration are kept, and all other rows are removed. This search is case-sensitive.

This enrichment is the opposite of the selectin enrichment.

If you want to use the selectnotin custom script instruction to select rows containing numbers, the values used in the instruction must be in numeric format. If necessary, use the convertnumbers custom script instruction to convert string values to a numeric format. Add the convertnumbers instruction to the same custom script enrichment before the selectnotin instruction.

Creating a custom script enrichment using the selectnotin instruction

To create and configure a custom script using the selectnotin instruction, follow these steps:

  1. Create a custom script enrichment.

  2. In the Instructions step, select the selectnotin instruction.

  3. To configure the custom script instruction, fill in the following fields. Required fields are marked with an asterisk (*).

Field*

Enter the name of the column that contains the value used to identify which row to remove.

Select a column in one of the following ways:

  • Select String and enter the name of the column.

  • Select Integer and enter the position of the column in the data extract as an index value. Counting starts at 0. To select the first column, enter 0. To select the second column, enter 1. To select the last column in the data extract, enter -1.

Value*

Enter the value used to identify which row to remove from the data extract. To add multiple values to the search criteria, click + and enter another value. The search is case-sensitive and only the values in the data extract that are not an exact match to the entered values are kept.

Complement

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

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 enrichment 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 enrichment and optionally as the output.

Example

Enrichment configuration

Field*

Ad Group

Value

ecommerce

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

Clicks

Brand

media

7

Dashboard

brand awareness

18

Brand

Ecommerce

4

Dashboard

media|social

5

Branding

media

11