Select-Data-Column
Command Description
Select data columns in a datatable and return a new datatable
Command Prototype
objDatatable = Datatable.SelectDataTableColumns(dtTable,aryColumns)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
dtTable | True | expression | objDatatable | The data table to be filtered |
aryColumns | True | expression | [] | Columns to be kept |
return
objDatatable,The variable used to save the output of the command.
Demo
aryData = [["a", 1], ["b", 2], ["c", 3]]
aryColumns = ["letter", "number"]
objDatatable = Datatable.BuildDataTable(aryData,aryColumns)
objDatatable = Datatable.SelectDataTableColumns(objDatatable,["letter"])
TracePrint(objDatatable)
/*
letter
0 a
1 b
2 c
*/