reorder

Reorder the columns in a data extract.

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

Introduction

Use the reorder instruction to reorder the columns in your data extract. Any columns names you do not include in the transformation are kept in their original position.

Creating a custom script transformation using the reorder instruction

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

  1. Create a custom script transformation.

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

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

Fields*

Click Add and enter the name of the column to be reordered. The order in which you enter the column names are the order in which they are reordered.

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

Fields*

Ad Group

Clicks

Views

Data table before transformation

Ad Group

Campaign

Clicks

Views

media

Brand

756

2771

ecommerce

Brand

351

1108

media

Dashboard

183

1080

media|social

Dashboard

51

239

media

Dashboard

117

781

Data table after transformation

Ad Group

Clicks

Views

Campaign

media

756

2771

Brand

ecommerce

351

1108

Brand

media

183

1080

Dashboard

media|social

51

239

Dashboard

media

117

781

Dashboard