tail
Return a set number of rows from the bottom of the data extract.
This guide explains how to configure the tail instruction. To learn about another instruction, go back to the Available custom script instructions overview.
Introduction
Use the tail instruction to return a set number of rows from the bottom of the data extract. All other rows are removed from the data extract. This is the opposite of the head transformation.
Creating a custom script transformation using the tail instruction
To create and configure a custom script using the tail instruction, follow these steps:
-
In the Instructions step, select the tail instruction.
-
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.
-
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
-
N*
-
3
Data table before transformation
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 transformation
Row Number |
Campaign |
Account IDs |
---|---|---|
5 |
Rank |
796714697 |
6 |
Tampflex |
698305305 |
7 |
Holdlamis |
604447800 |