head

Return a set number of rows from the top of the data extract.

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

Introduction

Use the head instruction to return a set number of rows from the top of the data extract. All other rows are removed from the data extract. This is the opposite of the tail enrichment.

Creating a custom script enrichment using the head instruction

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

  1. Create a custom script enrichment.

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

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

N*

Enter the number of rows to be returned from the top of the data extract.

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

N*

3

Data table before enrichment

Row Number

Campaign

Account IDs

1

Aerified

377303400

2

Kanlam

634282082

3

Y-find

439889356

4

Stringtough

515023082

5

Rank

796714697

6

Tampflex

698305305

7

Holdlamis

604447800

Data table after enrichment

Row Number

Campaign

Account IDs

1

Aerified

377303400

2

Kanlam

634282082

3

Y-find

439889356