|
Dataset - Insert column |
Declaration
<AMDATASET ACTIVITY="insert_column" DATASET="text" COLUMNLOCATION="text (options)" INDEX="number" COLUMNNAME="text" NEWCOLUMNNAME="text" />
Description
Inserts an blank column anywhere in a dataset.
Practical Usage
Used to insert an blank column anywhere in a dataset.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Dataset name | Text | Yes | (Empty) | DATASET="customers" | Specifies the dataset to insert the column into. |
Insert at | Text (options) | Yes | End |
|
Specifies where to insert the column at. The options are:
|
Column index | Number | Yes, if Insert at is set to Column index | (Empty) | INDEX="5" | The column index number to insert the column at. This parameter is required if Insert at is set to Column index. NOTE: The column index number entered must be greater than 0. |
Column name | Text | Yes, if Insert at is set to Before specified column name or After specified column name | (Empty) | COLUMNNAME="Status" | The name of the column to insert the new column before or after. This parameter is required if Insert at is set to Before specified column name or After specified column name. NOTE: All available columns stored in the dataset will automatically appear in the Column name drop-down combo box after the selected dataset has been run at least once in the Task Builder. |
New column name | Text | Yes | (Empty) | NEWCOLUMNNAME="New" | The name of the column to insert. |
Example
NOTE:
- The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
- Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.
Description
This task uses the Create, Insert Row, and Insert Column Dataset activities to first create a dataset with three columns, append a blank row at the end of it, and then finally inserts a new starting column in the dataset.
Copy
<AMDATASET RESULTDATASET="myDataset" COLUMNS="heading1;heading2;heading3" DELIMITER="semi_colon" DESCRIPTION="This is user input description showing in variables panel of Task Builder" />
<AMDATASET ACTIVITY="insert_row" DATASET="myDataset"><COLUMNSETTER COLUMNNAME="heading1" VALUE="value1" /><COLUMNSETTER COLUMNNAME="heading2" VALUE="value2" /><COLUMNSETTER COLUMNNAME="heading3" VALUE="value3" /></AMDATASET>
<AMDATASET ACTIVITY="insert_column" DATASET="myDataset" COLUMNLOCATION="index" INDEX="1" NEWCOLUMNNAME="First Heading" />