sort
Sort the data in a data extract.
Introduction
Use the sort enrichment to sort data in the data extract. You can enter multiple columns to sort. The order in which you enter the columns is the order in which the columns are sorted. See the example below.
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 (*).
-
Key
-
Enter the name of the column to sort. Click
to add another column to sort.
-
Reverse
-
Select this field to sort the data in reverse. If left unselected, the data is ordered in ascending order.
-
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
Enrichment configuration
-
Key
-
Campaign
-
Ad Group
Data table before enrichment
Campaign |
Ad Group |
Clicks |
---|---|---|
Brand |
media |
7 |
Brand |
ecommerce |
3 |
Dashboard |
ecommerce |
18 |
Brand |
ecommerce |
4 |
Dashboard |
media|social |
5 |
Dashboard |
media |
11 |
Data table after enrichment
Campaign |
Ad Group |
Clicks |
---|---|---|
Brand |
ecommerce |
3 |
Brand |
ecommerce |
4 |
Brand |
media |
7 |
Dashboard |
ecommerce |
18 |
Dashboard |
media |
11 |
Dashboard |
media|social |
5 |