|
Dataset - Delete column |
Declaration
<AMDATASET ACTIVITY="delete_column" DATASET="text" COLUMNBY="index" COLUMN="number" />
Description
Deletes a specified column from a dataset.
Practical Usage
Used to delete a specified column from a dataset.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Dataset name | Text | Yes | (Empty) | DATASET="Customers" | Specifies the dataset to delete the column from. |
Select by | Text (options) | Yes | Column name |
|
Specifies how to identify the column to delete. The options are:
|
Column name | Text | Yes, if Select by is set to Column name | (Empty) | COLUMN="Notes" | The column name to delete. This parameter is required if Select by is set to 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. |
Column index | Number | Yes, if Select by is set to Column index | (Empty) | COLUMN="24" | The column index number to delete. This parameter is required if Select column by is set to Column index. NOTE: The column index number entered must be greater than 0. |
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 Delete Column Dataset activities to first create a dataset with three columns, append a row with data at the end of it, and then finally removes one of the columns from the dataset by column name.
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="delete_column" DATASET="myDataset" COLUMN="heading2" />